From d64de3925b13bc9631e33762c65546edcb1e5af0 Mon Sep 17 00:00:00 2001 From: Toni Grabulosa Date: Thu, 7 Mar 2024 10:17:34 +0100 Subject: [PATCH] add build cache for docker image and use itkavehome user for registry authentication --- .github/workflows/deploy_new_image_version.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy_new_image_version.yaml b/.github/workflows/deploy_new_image_version.yaml index b3c5d3e59..845090f2a 100644 --- a/.github/workflows/deploy_new_image_version.yaml +++ b/.github/workflows/deploy_new_image_version.yaml @@ -34,14 +34,14 @@ jobs: id: prepare-outputs run: | - echo "IMAGE_REPOSITORY=$(printf ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + echo "IMAGE_REPOSITORY_LOWERCASE=$(printf ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - name: Log in to GitHub Docker Registry uses: docker/login-action@v1 with: registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: itkavehome + password: ${{ secrets.ITKAVEHOME_GITHUB_TOKEN }} - name: Build&Push App container image uses: docker/build-push-action@v4 @@ -49,7 +49,9 @@ jobs: file: Dockerfile push: true tags: | - ghcr.io/${{ env.IMAGE_REPOSITORY }}:${{ env.TAG }} + ghcr.io/${{ env.IMAGE_REPOSITORY_LOWERCASE }}:${{ env.TAG }} + cache-from: type=registry,ref=ghcr.io/${{ env.IMAGE_REPOSITORY_LOWERCASE }}:build-cache + cache-to: type=registry,ref=ghcr.io/${{ env.IMAGE_REPOSITORY_LOWERCASE }}:build-cache - name: Install Helm uses: azure/setup-helm@v3