Skip to content

Attempt uploading docker image to dockerhub automatically. #13

Attempt uploading docker image to dockerhub automatically.

Attempt uploading docker image to dockerhub automatically. #13

Workflow file for this run

name: Docker
on: [push]
jobs:
build:
runs-on: ubuntu-latest
# If we are on the master branch, build for all architectures.
# Otherwise, only build on the architecture for which we can
# get a runner (for speed).
strategy:
fail-fast: false
if: ${{ github.ref == "master" }}
matrix:

Check failure on line 15 in .github/workflows/docker.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker.yml

Invalid workflow file

You have an error in your yaml syntax on line 15
arch:
- amd64
- arm64
if: ${{ github.ref != "master" }}
matrix:
arch:
- amd64
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 master branch
if: github.ref != 'refs/heads/master'
run: exit 1
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: kpeeters/cadabra2-jupyter
- 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: ${{ github.ref == "master" }}
tags: cadabra2-jupyter-${{ matrix.arch }}:latest
outputs: type=docker,dest=cadabra2-jupyter-${{ matrix.arch }}.tar
- name: Upload artifact to github assets
uses: actions/upload-artifact@v4
with:
name: cadabra2-jupyter-${{ matrix.arch }}
path: cadabra2-jupyter-${{ matrix.arch }}.tar