Don't use sudo inside docker. #44
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
# Build docker images with a Jupyter server with Cadabra | |
# kernel whenever a commit is pushed to github. | |
# | |
# Lint this thing with | |
# | |
# yq eval docker.yml | |
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@master | |
- 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@master | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@master | |
with: | |
images: kpeeters/cadabra2-jupyter | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@master | |
- name: Build Docker image | |
uses: docker/build-push-action@master | |
with: | |
platforms: linux/amd64, linux/arm64 | |
context: . | |
file: docker/Dockerfile | |
push: true | |
#${{ github.ref == 'master' }} | |
labels: ${{ steps.meta.outputs.labels }} | |
tags: kpeeters/cadabra2-jupyter:latest | |
# outputs: type=docker | |
# - name: Upload artifact to github assets | |
# uses: actions/upload-artifact@main | |
# with: | |
# name: cadabra2-jupyter-${{ matrix.arch }} | |
# path: cadabra2-jupyter-${{ matrix.arch }}.tar |