gha: build-kata-static-tarball: Only push to registry after merge

56331bd7bc 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 <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-04-04 10:50:39 +02:00
parent e81b8b8ee5
commit 2550d4462d
4 changed files with 21 additions and 3 deletions

View File

@ -9,6 +9,10 @@ on:
tarball-suffix: tarball-suffix:
required: false required: false
type: string type: string
push-to-registry:
required: false
type: string
default: no
jobs: jobs:
build-asset: build-asset:
@ -40,7 +44,7 @@ jobs:
env: env:
KATA_ASSET: ${{ matrix.asset }} KATA_ASSET: ${{ matrix.asset }}
TAR_OUTPUT: ${{ matrix.asset }}.tar.gz TAR_OUTPUT: ${{ matrix.asset }}.tar.gz
PUSH_TO_REGISTRY: yes PUSH_TO_REGISTRY: ${{ inputs.push-to-registry }}
- name: store-artifact ${{ matrix.asset }} - name: store-artifact ${{ matrix.asset }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

View File

@ -9,6 +9,10 @@ on:
tarball-suffix: tarball-suffix:
required: false required: false
type: string type: string
push-to-registry:
required: false
type: string
default: no
jobs: jobs:
build-asset: build-asset:
@ -44,7 +48,7 @@ jobs:
env: env:
KATA_ASSET: ${{ matrix.asset }} KATA_ASSET: ${{ matrix.asset }}
TAR_OUTPUT: ${{ matrix.asset }}.tar.gz TAR_OUTPUT: ${{ matrix.asset }}.tar.gz
PUSH_TO_REGISTRY: yes PUSH_TO_REGISTRY: ${{ inputs.push-to-registry }}
- name: store-artifact ${{ matrix.asset }} - name: store-artifact ${{ matrix.asset }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

View File

@ -9,6 +9,10 @@ on:
tarball-suffix: tarball-suffix:
required: false required: false
type: string type: string
push-to-registry:
required: false
type: string
default: no
jobs: jobs:
build-asset: build-asset:
@ -41,7 +45,7 @@ jobs:
env: env:
KATA_ASSET: ${{ matrix.asset }} KATA_ASSET: ${{ matrix.asset }}
TAR_OUTPUT: ${{ matrix.asset }}.tar.gz TAR_OUTPUT: ${{ matrix.asset }}.tar.gz
PUSH_TO_REGISTRY: yes PUSH_TO_REGISTRY: ${{ inputs.push-to-registry }}
- name: store-artifact ${{ matrix.asset }} - name: store-artifact ${{ matrix.asset }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

View File

@ -8,12 +8,18 @@ on:
jobs: jobs:
build-assets-amd64: build-assets-amd64:
uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml
with:
push-to-registry: yes
build-assets-arm64: build-assets-arm64:
uses: ./.github/workflows/build-kata-static-tarball-arm64.yaml uses: ./.github/workflows/build-kata-static-tarball-arm64.yaml
with:
push-to-registry: yes
build-assets-s390x: build-assets-s390x:
uses: ./.github/workflows/build-kata-static-tarball-s390x.yaml uses: ./.github/workflows/build-kata-static-tarball-s390x.yaml
with:
push-to-registry: yes
publish-kata-deploy-payload-amd64: publish-kata-deploy-payload-amd64:
needs: build-assets-amd64 needs: build-assets-amd64