Skip to content

Commit

Permalink
Allow skipping multiarch builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Molter73 committed Oct 4, 2023
1 parent b4e3339 commit 70d4271
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion .github/workflows/collector-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ jobs:
} > ${{ github.workspace }}/ansible/secrets.yml
- name: Build images
if: |
github.event_name == 'push' ||
matrix.arch == 'amd64' ||
!contains(github.event.pull_request.labels.*.name, 'skip-multiarch-builds')
timeout-minutes: 480
run: |
ansible-galaxy install -r ansible/requirements.yml
Expand All @@ -107,7 +111,8 @@ jobs:
runs-on: ubuntu-latest
if: |
github.event_name == 'push' ||
needs.build-builder-image.outputs.collector-builder-tag != 'cache'
(needs.build-builder-image.outputs.collector-builder-tag != 'cache' &&
!contains(github.event.pull_request.labels.*.name, 'skip-multiarch-builds'))
env:
COLLECTOR_BUILDER_TAG: ${{ needs.build-builder-image.outputs.collector-builder-tag }}
ARCHS: amd64 ppc64le s390x
Expand Down Expand Up @@ -141,3 +146,32 @@ jobs:
base-image: quay.io/rhacs-eng/collector-builder:${{ env.COLLECTOR_BUILDER_TAG }}
archs: ${{ env.ARCHS }}

retag-x86-image:
needs:
- build-builder-image
name: Retag x86 builder image
runs-on: ubuntu-latest
if: |
github.event_name == 'pull_request' &&
needs.build-builder-image.outputs.collector-builder-tag != 'cache' &&
contains(github.event.pull_request.labels.*.name, 'skip-multiarch-builds')
steps:
- name: Pull image to retag
run: |
docker pull "quay.io/stackrox-io/collector-builder:${COLLECTOR_BUILDER_TAG}-amd64"
- name: Retag and push stackrox-io -slim
uses: stackrox/actions/images/retag-and-push@v1
with:
src-image: quay.io/stackrox-io/collector-builder:${{ env.COLLECTOR_BUILDER_TAG }}-amd64
dst-image: quay.io/stackrox-io/collector-builder:${{ env.COLLECTOR_BUILDER_TAG }}
username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}
password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}

- name: Retag and push rhacs-eng -slim
uses: stackrox/actions/images/retag-and-push@v1
with:
src-image: quay.io/stackrox-io/collector-builder:${{ env.COLLECTOR_BUILDER_TAG }}-amd64
dst-image: quay.io/rhacs-eng/collector-builder:${{ env.COLLECTOR_BUILDER_TAG }}
username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}
password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}

0 comments on commit 70d4271

Please sign in to comment.