From f6005fe1e196228117f2d7b7f6b4a770d3143f47 Mon Sep 17 00:00:00 2001 From: Andrii Lundiak Date: Wed, 14 Sep 2022 18:38:18 +0200 Subject: [PATCH] [HZN-2841] Added additional changes to bed able to build images on DockerHub and ghcr.io --- .github/workflows/publish.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4cd7e87..cf03b52 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,15 +22,15 @@ jobs: - uses: actions/checkout@master - run: echo "${{ env.testStr }}" - - name: "[Dockerhub] Docker login" - if: ${{ env.USE_DOCKERHUB && env.IS_RELEASE == 'true' }} + - name: "DockerHub login" + if: ${{ env.USE_DOCKERHUB == 'true' && env.IS_RELEASE == 'true' }} uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} - - name: "[GHCR] Docker login" - if: ${{ env.USE_GHCR && env.IS_RELEASE == 'true' }} + - name: "GitHub Container Registry (ghcr.io) login" + if: ${{ env.USE_GHCR == 'true' && env.IS_RELEASE == 'true' }} uses: docker/login-action@v1 with: registry: ghcr.io # docker.pkg.github.com @@ -48,6 +48,9 @@ jobs: context: . # platforms: linux/amd64,linux/arm64 # by default linux.amd64 push: ${{ env.IS_RELEASE == 'true' }} + # to use DockerHub here, need to add below two tags lines: + # ${{ secrets.DOCKERHUB_USERNAME }}/kube-nginx-proxy:${{ env.TAG }} + # ${{ secrets.DOCKERHUB_USERNAME }}/kube-nginx-proxy:latest tags: | ghcr.io/${{ github.repository_owner }}/kube-nginx-proxy:${{ env.TAG }} ghcr.io/${{ github.repository_owner }}/kube-nginx-proxy:latest