Updated PyFR image and CI workflow #1
This file contains hidden or 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: Release of PyFR container multi-arch | |
| on: | |
| push: | |
| paths: | |
| - 'hpc/applications/pyfr/Containerfile' | |
| - '.github/workflows/release-pyfr.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| packages: write | |
| actions: read | |
| env: | |
| REGISTRY: ghcr.io | |
| REPO: ghcr.io/${{ github.repository }}/pyfr | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-latest | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| id: buildx | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & push single-arch image | |
| run: | | |
| docker buildx build \ | |
| --builder "${{ steps.buildx.outputs.name }}" \ | |
| --platform linux/${{ matrix.arch }} \ | |
| --file hpc/applications/pyfr/Containerfile \ | |
| --tag "${{ env.REPO }}:build-${{ matrix.arch }}" \ | |
| --push \ | |
| . | |
| # Multi-arch manifest that references both images | |
| manifest: | |
| name: Create multi-arch manifest | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Verify single-arch images exist | |
| run: | | |
| set -euo pipefail | |
| IMAGES=( | |
| "${{ env.REPO }}:build-amd64" | |
| "${{ env.REPO }}:build-arm64" | |
| ) | |
| for img in "${IMAGES[@]}"; do | |
| echo "Inspecting $img ..." | |
| if ! docker buildx imagetools inspect "$img" > /dev/null; then | |
| echo "::error file=manifest.yml::Image not found: $img" | |
| exit 1 | |
| fi | |
| done | |
| - name: Create & push multi-arch manifest | |
| run: | | |
| TAG=$(skopeo inspect --config docker://${{ env.REPO }}:build-amd64 | jq '.config.Labels["org.opencontainers.image.version"]' | tr -d '"') | |
| docker buildx imagetools create \ | |
| --tag "${{ env.REPO }}:${TAG}" \ | |
| "${{ env.REPO }}:build-amd64" \ | |
| "${{ env.REPO }}:build-arm64" |