From 358690d08b638d4319229e58858a50be76031971 Mon Sep 17 00:00:00 2001 From: Finlay Davidson Date: Fri, 8 Jul 2022 22:48:59 +0200 Subject: [PATCH] Docker workflow use separate username for login --- .github/workflows/docker.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9b2eda82..c567b4b2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,8 +13,6 @@ on: jobs: build: runs-on: ubuntu-latest - env: - USERNAME: infinitime steps: - uses: actions/checkout@v3 @@ -22,7 +20,7 @@ jobs: if: github.event_name == 'push' uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }} + username: ${{ secrets.DOCKER_HUB_LOGIN_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Set up Docker metadata @@ -30,7 +28,7 @@ jobs: uses: docker/metadata-action@v4 with: images: | - ${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build + ${{ secrets.DOCKER_HUB_IMAGE_USERNAME }}/infinitime-build tags: | type=sha type=raw,value=latest @@ -53,8 +51,8 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build:buildcache - cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build:buildcache,mode=max + cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_IMAGE_USERNAME }}/infinitime-build:buildcache + cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_IMAGE_USERNAME }}/infinitime-build:buildcache,mode=max - name: Build if: github.event_name != 'push' @@ -65,4 +63,4 @@ jobs: platforms: linux/amd64,linux/arm64 builder: ${{ steps.buildx.outputs.name }} push: false - cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build:buildcache + cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_IMAGE_USERNAME }}/infinitime-build:buildcache