You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2022/03/30 19:14:54 UTC

[libcloud-site] 01/02: Also test pushing images to github container registry.

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/libcloud-site.git

commit 70e9c8d24afed811b2eb840f02e194f18100fb16
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Wed Mar 30 21:09:03 2022 +0200

    Also test pushing images to github container registry.
---
 .github/workflows/build_docker_image.yaml | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build_docker_image.yaml b/.github/workflows/build_docker_image.yaml
index dc67e10..097298f 100644
--- a/.github/workflows/build_docker_image.yaml
+++ b/.github/workflows/build_docker_image.yaml
@@ -13,6 +13,10 @@ on:
   schedule:
     - cron: '0 1 * * *'
 
+env:
+  REGISTRY: ghcr.io
+  IMAGE_NAME: "libcloud-site-dev"
+
 jobs:
   # Special job which skips duplicate jobs
   pre_job:
@@ -38,6 +42,9 @@ jobs:
     name: Build Docker Image
     runs-on: ubuntu-latest
     timeout-minutes: 8
+    permissions:
+      contents: read
+      packages: write
 
     needs: pre_job
     if: ${{ needs.pre_job.outputs.should_skip == 'false' || github.ref == 'refs/heads/master' }}
@@ -53,11 +60,12 @@ jobs:
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v1
 
-      # - name: Login to DockerHub
-      #   uses: docker/login-action@v1
-      #   with:
-      #     username: ${{ secrets.DOCKERHUB_USERNAME }}
-      #     password: ${{ secrets.DOCKERHUB_TOKEN }}
+      - name: Log in to the Github Container registry
+        uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
+        with:
+          registry: ${{ env.REGISTRY }}
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
 
       - name: Build and push
         uses: docker/build-push-action@v2
@@ -65,4 +73,4 @@ jobs:
           context: .
           platforms: linux/amd64,linux/arm64
           push: false
-          tags: libcloud-dev/libcloud-website-dev:latest
+          tags: ghcr.io/apache/libcloud-site-dev:latest