Add architecture to docker image name. #10
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: Docker | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: | |
- amd64 | |
- arm64 | |
steps: | |
- name: Prepare | |
run: | | |
platform=${{ matrix.platform }} | |
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- uses: actions/checkout@v3 | |
- name: Exit if not on devel branch | |
if: github.ref != 'refs/heads/devel' | |
run: exit 1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
platforms: linux/${{ matrix.arch }} | |
labels: ${{ steps.meta.outputs.labels }} | |
context: . | |
file: docker/Dockerfile | |
push: false | |
tags: cadabra2-jupyter-${{ matrix.arch }}:latest | |
outputs: type=docker | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cadabra2-jupyter-${{ matrix.arch }} |