From 3daa39080a7866d83fad0fb3691e9e31397e0f6c Mon Sep 17 00:00:00 2001 From: "Jens L." Date: Sat, 25 Jan 2025 02:54:03 +0100 Subject: [PATCH] ci: fix container build always attempting to push (#12810) Signed-off-by: Jens Langhammer --- .github/workflows/_reusable-docker-build-single.yaml | 3 ++- .github/workflows/_reusable-docker-build.yaml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_reusable-docker-build-single.yaml b/.github/workflows/_reusable-docker-build-single.yaml index c7896a8c093d..7dd505918ee2 100644 --- a/.github/workflows/_reusable-docker-build-single.yaml +++ b/.github/workflows/_reusable-docker-build-single.yaml @@ -77,7 +77,7 @@ jobs: id: push with: context: . - push: true + push: ${{ steps.ev.outputs.shouldPush == 'true' }} secrets: | GEOIPUPDATE_ACCOUNT_ID=${{ secrets.GEOIPUPDATE_ACCOUNT_ID }} GEOIPUPDATE_LICENSE_KEY=${{ secrets.GEOIPUPDATE_LICENSE_KEY }} @@ -89,6 +89,7 @@ jobs: cache-to: ${{ steps.ev.outputs.cacheTo }} - uses: actions/attest-build-provenance@v2 id: attest + if: ${{ steps.ev.outputs.shouldPush == 'true' }} with: subject-name: ${{ steps.ev.outputs.attestImageNames }} subject-digest: ${{ steps.push.outputs.digest }} diff --git a/.github/workflows/_reusable-docker-build.yaml b/.github/workflows/_reusable-docker-build.yaml index 833c9d443ddf..c781b9400c2e 100644 --- a/.github/workflows/_reusable-docker-build.yaml +++ b/.github/workflows/_reusable-docker-build.yaml @@ -46,6 +46,7 @@ jobs: - build-server-arm64 outputs: tags: ${{ steps.ev.outputs.imageTagsJSON }} + shouldPush: ${{ steps.ev.outputs.shouldPush }} steps: - uses: actions/checkout@v4 - name: prepare variables @@ -57,6 +58,7 @@ jobs: image-name: ${{ inputs.image_name }} merge-server: runs-on: ubuntu-latest + if: ${{ needs.get-tags.outputs.shouldPush == 'true' }} needs: - get-tags - build-server-amd64