From 85be11cb5b19098a8bc673c56afeac296916379a Mon Sep 17 00:00:00 2001 From: Mariusz Kogen Date: Tue, 29 Oct 2024 20:25:23 +0100 Subject: [PATCH] fix: Use digest to tag Docker image as 'latest' to prevent missing image error --- .github/workflows/sdk-utils.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sdk-utils.yaml b/.github/workflows/sdk-utils.yaml index a326812..d863410 100644 --- a/.github/workflows/sdk-utils.yaml +++ b/.github/workflows/sdk-utils.yaml @@ -52,6 +52,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push + id: build_and_push uses: docker/build-push-action@v6 with: context: utils @@ -64,7 +65,7 @@ jobs: cache-to: type=local,dest=/tmp/.buildx-cache,new=true - name: Tag as latest if requested - if: ${{ inputs.publish_as_latest == 'true' }} + if: ${{ inputs.publish_as_latest }} run: | - docker tag ghcr.io/start9labs/sdk/utils:${{ github.sha }} ghcr.io/start9labs/sdk/utils:latest - docker push ghcr.io/start9labs/sdk/utils:latest + docker manifest create ghcr.io/start9labs/sdk/utils:latest --amend ghcr.io/start9labs/sdk/utils@${{ steps.build_and_push.outputs.digest }} + docker manifest push ghcr.io/start9labs/sdk/utils:latest