0.0.34 #34
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: Build Release | |
on: | |
release: | |
types: | |
- published | |
push: | |
branches: [ ghactions ] | |
env: | |
IMAGE_NAME: preflight | |
jobs: | |
build-release: | |
name: Build and push tag images | |
strategy: | |
matrix: | |
architecture: [amd64,ppc64le,arm64,s390x] | |
platform: [linux] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Env Tags | |
run: echo RELEASE_TAG=$(echo $GITHUB_REF | cut -d '/' -f 3) >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Build Image | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ secrets.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: ${{ env.RELEASE_TAG }}-${{ matrix.platform }}-${{ matrix.architecture }} | |
archs: ${{ matrix.architecture }} | |
build-args: | | |
release_tag=${{env.RELEASE_TAG }} | |
ARCH=${{ matrix.architecture }} | |
dockerfiles: | | |
./Dockerfile | |
- name: Push Image | |
id: push-image | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ env.IMAGE_NAME }} | |
tags: ${{ env.RELEASE_TAG }}-${{ matrix.platform }}-${{ matrix.architecture }} | |
registry: ${{ secrets.IMAGE_REGISTRY }} | |
username: ${{ secrets.REGISTRY_USER }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Print image url | |
run: echo "Image pushed to ${{ steps.push-image.outputs.registry-paths }}" | |
outputs: | |
imageName: ${{ env.IMAGE_NAME }} | |
imageVersion: ${{ env.RELEASE_TAG }} | |
commitSHA: ${{ github.sha }} | |
pyxisHost: ${{ vars.PYXIS_HOST }} | |
build-multiarch: | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
needs: build-release | |
uses: ./.github/workflows/build-multiarch.yml | |
with: | |
name: ${{ needs.build-release.outputs.imageName }} | |
tag: ${{ needs.build-release.outputs.imageVersion }} | |
sign: true | |
secrets: | |
registry: ${{ secrets.IMAGE_REGISTRY }} | |
user: ${{ secrets.REGISTRY_USER }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
extract-assets: | |
needs: build-release | |
uses: ./.github/workflows/release-artifacts.yml | |
with: | |
name: ${{ needs.build-release.outputs.imageName }} | |
tag: ${{ needs.build-release.outputs.imageVersion }} | |
secrets: | |
registry: ${{ secrets.IMAGE_REGISTRY }} | |
user: ${{ secrets.REGISTRY_USER }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
add-release-info-to-pyxis: | |
needs: [build-release, extract-assets] | |
uses: ./.github/workflows/add-release-info-to-pyxis.yml | |
if: "!github.event.release.prerelease" | |
with: | |
tag: ${{ needs.build-release.outputs.imageVersion }} | |
commit: ${{ needs.build-release.outputs.commitSHA }} | |
host: ${{ needs.build-release.outputs.pyxisHost }} | |
secrets: | |
certificate: ${{ secrets.PREFLIGHT_RELEASE_CERTIFICATE }} | |
key: ${{ secrets.PREFLIGHT_RELEASE_KEY }} | |
certificatePassword: ${{ secrets.PREFLIGHT_RELEASE_PASSWORD }} | |
copy-to-rhisv: | |
needs: [build-release, build-multiarch] | |
uses: ./.github/workflows/copy-to-rhisv.yml | |
with: | |
sourceImageName: ${{ needs.build-release.outputs.imageName }} | |
sourceImageTag: ${{ needs.build-release.outputs.imageVersion }} | |
destImageName: preflight-test | |
secrets: | |
sourceImageRegistry: ${{ secrets.IMAGE_REGISTRY }} | |
destImageRegistry: ${{ secrets.RHISV_IMAGE_REGISTRY }} | |
destRegistryUser: ${{ secrets.RHISV_REGISTRY_USER }} | |
destRegistryPassword: ${{ secrets.RHISV_REGISTRY_PASSWORD }} |