Skip to content

Commit

Permalink
Allow skipping multiarch builder (#1356)
Browse files Browse the repository at this point in the history
  • Loading branch information
Molter73 authored Oct 6, 2023
1 parent 4bc1d8e commit 7725251
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 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,34 @@ 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')
env:
COLLECTOR_BUILDER_TAG: ${{ needs.build-builder-image.outputs.collector-builder-tag }}
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
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
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 7725251

Please sign in to comment.