OPCT-257: fixes/ci pipeline to publish multi-arch manifests #323
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: test-build-release | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
tags: ['v*.*.*'] | |
jobs: | |
linters: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Shellcheck - hack | |
uses: azohra/shell-linter@latest | |
with: | |
path: "hack/*.sh" | |
- name: Shellcheck - Plugin - openshift-tests | |
uses: azohra/shell-linter@latest | |
with: | |
path: './openshift-tests-provider-cert/plugin/*.sh' | |
- name: Shellcheck - Plugin - openshift-tests - hack | |
uses: azohra/shell-linter@latest | |
with: | |
path: './openshift-tests-provider-cert/hack/*.sh' | |
build-amd64: | |
runs-on: ubuntu-latest | |
needs: [linters] | |
env: | |
VERSION: "v0.0.0-devel-pr.${{ github.event.pull_request.number }}" | |
PLATFORMS: linux/amd64,linux/arm64 | |
EXPIRATION: 1d | |
PUSH: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USER }} | |
password: ${{ secrets.QUAY_PASS }} | |
- name: Build and push - plugin | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: ${{ env.PLATFORMS }} | |
push: ${{ env.PUSH }} | |
labels: | | |
quay.expires-after=${{ env.EXPIRATION }} | |
build-args: | | |
QUAY_EXPIRATION=${{ env.EXPIRATION }} | |
tags: quay.io/opct/plugin-openshift-tests:${{ env.VERSION }} | |
context: ./openshift-tests-provider-cert | |
file: ./openshift-tests-provider-cert/Containerfile | |
- name: Build and push - must-gather-monitoring | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: ${{ env.PLATFORMS }} | |
push: ${{ env.PUSH }} | |
labels: | | |
quay.expires-after=${{ env.EXPIRATION }} | |
build-args: | | |
QUAY_EXPIRATION=${{ env.EXPIRATION }} | |
tags: quay.io/opct/must-gather-monitoring:${{ env.VERSION }} | |
context: ./must-gather-monitoring | |
file: ./must-gather-monitoring/Containerfile | |
# | |
# Releasing: triggered when push to main | |
# | |
release-latest: | |
if: startsWith(github.ref, 'refs/head/main') | |
runs-on: ubuntu-latest | |
needs: [build-amd64] | |
env: | |
VERSION: "latest" | |
PLATFORMS: linux/amd64,linux/arm64 | |
EXPIRATION: never | |
PUSH: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USER }} | |
password: ${{ secrets.QUAY_PASS }} | |
- name: Build and push - plugin | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: ${{ env.PLATFORMS }} | |
push: ${{ env.PUSH }} | |
labels: | | |
quay.expires-after=${{ env.EXPIRATION }} | |
build-args: | | |
QUAY_EXPIRATION=${{ env.EXPIRATION }} | |
tags: quay.io/opct/plugin-openshift-tests:${{ env.VERSION }} | |
context: ./openshift-tests-provider-cert | |
file: ./openshift-tests-provider-cert/Containerfile | |
- name: Build and push - must-gather-monitoring | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: ${{ env.PLATFORMS }} | |
push: ${{ env.PUSH }} | |
labels: | | |
quay.expires-after=${{ env.EXPIRATION }} | |
build-args: | | |
QUAY_EXPIRATION=${{ env.EXPIRATION }} | |
tags: quay.io/opct/must-gather-monitoring:${{ env.VERSION }} | |
context: ./must-gather-monitoring | |
file: ./must-gather-monitoring/Containerfile | |
# | |
# Releasing: triggered when a tag is created | |
# | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
needs: [build-amd64] | |
env: | |
PLATFORMS: linux/amd64,linux/arm64 | |
EXPIRATION: 1d | |
PUSH: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set vars | |
id: vars | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USER }} | |
password: ${{ secrets.QUAY_PASS }} | |
- name: Build and push - plugin | |
uses: docker/build-push-action@v6 | |
env: | |
VERSION: ${{ steps.vars.outputs.tag }} | |
with: | |
platforms: ${{ env.PLATFORMS }} | |
push: ${{ env.PUSH }} | |
labels: | | |
quay.expires-after=${{ env.EXPIRATION }} | |
build-args: | | |
QUAY_EXPIRATION=${{ env.EXPIRATION }} | |
tags: quay.io/opct/plugin-openshift-tests:${{ env.VERSION }} | |
context: ./openshift-tests-provider-cert | |
file: ./openshift-tests-provider-cert/Containerfile | |
- name: Build and push - must-gather-monitoring | |
uses: docker/build-push-action@v6 | |
env: | |
VERSION: ${{ steps.vars.outputs.tag }} | |
with: | |
platforms: ${{ env.PLATFORMS }} | |
push: ${{ env.PUSH }} | |
labels: | | |
quay.expires-after=${{ env.EXPIRATION }} | |
build-args: | | |
QUAY_EXPIRATION=${{ env.EXPIRATION }} | |
tags: quay.io/opct/must-gather-monitoring:${{ env.VERSION }} | |
context: ./must-gather-monitoring | |
file: ./must-gather-monitoring/Containerfile | |
# https://github.com/mikepenz/release-changelog-builder-action#configuration | |
- name: Build Changelog | |
id: github_release | |
uses: mikepenz/[email protected] | |
with: | |
configuration: ".github/workflows/changelog-configuration.json" | |
# https://github.com/softprops/action-gh-release | |
- name: Create Release on Github | |
uses: softprops/[email protected] | |
env: | |
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | |
with: | |
body: | | |
## Changelog | |
Image published to [quay.io/ocp-cert/openshift-tests-provider-cert:$RELEASE_VERSION](https://quay.io/repository/ocp-cert/openshift-tests-provider-cert?tab=tags) | |
${{steps.github_release.outputs.changelog}} |