From 2550d4462dded7927b353b345166e10f4b04f6bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 4 Apr 2023 10:50:39 +0200 Subject: [PATCH] gha: build-kata-static-tarball: Only push to registry after merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 56331bd7bcfbc6aabd8a732a10c544ba3df84622 oversaw the fact that we mistakenly tried to push the build containers to the registry for a PR, rather than doing so only when the code is merged. As the workflow is now shared between different actions, let's introduce an input variable to specify which are the cases we actually need to perform a push to the registry. Fixes: #6592 Signed-off-by: Fabiano FidĂȘncio --- .github/workflows/build-kata-static-tarball-amd64.yaml | 6 +++++- .github/workflows/build-kata-static-tarball-arm64.yaml | 6 +++++- .github/workflows/build-kata-static-tarball-s390x.yaml | 6 +++++- .github/workflows/payload-after-push.yaml | 6 ++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-kata-static-tarball-amd64.yaml b/.github/workflows/build-kata-static-tarball-amd64.yaml index f668d16fb6..d2c902af23 100644 --- a/.github/workflows/build-kata-static-tarball-amd64.yaml +++ b/.github/workflows/build-kata-static-tarball-amd64.yaml @@ -9,6 +9,10 @@ on: tarball-suffix: required: false type: string + push-to-registry: + required: false + type: string + default: no jobs: build-asset: @@ -40,7 +44,7 @@ jobs: env: KATA_ASSET: ${{ matrix.asset }} TAR_OUTPUT: ${{ matrix.asset }}.tar.gz - PUSH_TO_REGISTRY: yes + PUSH_TO_REGISTRY: ${{ inputs.push-to-registry }} - name: store-artifact ${{ matrix.asset }} uses: actions/upload-artifact@v3 diff --git a/.github/workflows/build-kata-static-tarball-arm64.yaml b/.github/workflows/build-kata-static-tarball-arm64.yaml index e797dc824b..a508622310 100644 --- a/.github/workflows/build-kata-static-tarball-arm64.yaml +++ b/.github/workflows/build-kata-static-tarball-arm64.yaml @@ -9,6 +9,10 @@ on: tarball-suffix: required: false type: string + push-to-registry: + required: false + type: string + default: no jobs: build-asset: @@ -44,7 +48,7 @@ jobs: env: KATA_ASSET: ${{ matrix.asset }} TAR_OUTPUT: ${{ matrix.asset }}.tar.gz - PUSH_TO_REGISTRY: yes + PUSH_TO_REGISTRY: ${{ inputs.push-to-registry }} - name: store-artifact ${{ matrix.asset }} uses: actions/upload-artifact@v3 diff --git a/.github/workflows/build-kata-static-tarball-s390x.yaml b/.github/workflows/build-kata-static-tarball-s390x.yaml index cf22379b3e..064ed006b6 100644 --- a/.github/workflows/build-kata-static-tarball-s390x.yaml +++ b/.github/workflows/build-kata-static-tarball-s390x.yaml @@ -9,6 +9,10 @@ on: tarball-suffix: required: false type: string + push-to-registry: + required: false + type: string + default: no jobs: build-asset: @@ -41,7 +45,7 @@ jobs: env: KATA_ASSET: ${{ matrix.asset }} TAR_OUTPUT: ${{ matrix.asset }}.tar.gz - PUSH_TO_REGISTRY: yes + PUSH_TO_REGISTRY: ${{ inputs.push-to-registry }} - name: store-artifact ${{ matrix.asset }} uses: actions/upload-artifact@v3 diff --git a/.github/workflows/payload-after-push.yaml b/.github/workflows/payload-after-push.yaml index b828c57aa1..25a7a18c2c 100644 --- a/.github/workflows/payload-after-push.yaml +++ b/.github/workflows/payload-after-push.yaml @@ -8,12 +8,18 @@ on: jobs: build-assets-amd64: uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml + with: + push-to-registry: yes build-assets-arm64: uses: ./.github/workflows/build-kata-static-tarball-arm64.yaml + with: + push-to-registry: yes build-assets-s390x: uses: ./.github/workflows/build-kata-static-tarball-s390x.yaml + with: + push-to-registry: yes publish-kata-deploy-payload-amd64: needs: build-assets-amd64