|
| 1 | + |
| 2 | +# Build docker images with a Jupyter server with Cadabra |
| 3 | +# kernel whenever a commit is pushed to github. |
| 4 | +# |
| 5 | +# Lint this thing with |
| 6 | +# |
| 7 | +# yq eval docker.yml |
| 8 | + |
| 9 | +name: Docker |
| 10 | + |
| 11 | +on: [push] |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | +# strategy: |
| 18 | +# fail-fast: false |
| 19 | +# matrix: |
| 20 | +# arch: |
| 21 | +# - amd64 |
| 22 | +# - arm64 |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Prepare |
| 26 | + run: | |
| 27 | + platform=${{ matrix.platform }} |
| 28 | + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV |
| 29 | +
|
| 30 | + - name: Set up QEMU |
| 31 | + uses: docker/setup-qemu-action@master |
| 32 | + |
| 33 | + - uses: actions/checkout@v3 |
| 34 | + |
| 35 | +# - name: Exit if not on master branch |
| 36 | +# if: github.ref != 'refs/heads/master' |
| 37 | +# run: exit 1 |
| 38 | + |
| 39 | + - name: Log in to Docker Hub |
| 40 | + uses: docker/login-action@master |
| 41 | + with: |
| 42 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 43 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 44 | + |
| 45 | + - name: Extract metadata (tags, labels) for Docker |
| 46 | + id: meta |
| 47 | + uses: docker/metadata-action@master |
| 48 | + with: |
| 49 | + images: kpeeters/cadabra2-jupyter |
| 50 | + |
| 51 | + - name: Set up Docker Buildx |
| 52 | + uses: docker/setup-buildx-action@master |
| 53 | + |
| 54 | + - name: Build Docker image |
| 55 | + uses: docker/build-push-action@master |
| 56 | + with: |
| 57 | + platforms: linux/amd64, linux/arm64 |
| 58 | + context: . |
| 59 | + file: docker/Dockerfile |
| 60 | + push: true |
| 61 | +#${{ github.ref == 'master' }} |
| 62 | + labels: ${{ steps.meta.outputs.labels }} |
| 63 | + tags: kpeeters/cadabra2-jupyter:latest |
| 64 | +# outputs: type=docker |
| 65 | + |
| 66 | +# - name: Upload artifact to github assets |
| 67 | +# uses: actions/upload-artifact@main |
| 68 | +# with: |
| 69 | +# name: cadabra2-jupyter-${{ matrix.arch }} |
| 70 | +# path: cadabra2-jupyter-${{ matrix.arch }}.tar |
0 commit comments