1313 matrix :
1414 platform :
1515 - linux/amd64
16- # - linux/arm64
16+ - linux/arm64
1717 runs-on : ${{ matrix.platform == 'linux/amd64' && 'ubuntu-24.04' || matrix.platform == 'linux/arm64' && 'ubuntu-24.04-arm' }}
1818 name : build ${{ matrix.platform }}
1919 outputs :
@@ -39,45 +39,66 @@ jobs:
3939 with :
4040 images : ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
4141
42+ - name : Set up Docker Buildx
43+ id : buildx
44+ uses : docker/setup-buildx-action@v3.11.1
45+
46+ - name : Build and push by digest
47+ if : github.event_name == 'pull_request'
48+ uses : docker/build-push-action@v6.18.0
49+ with :
50+ file : ./docker/Dockerfile
51+ platforms : ${{ matrix.platform }}
52+ labels : ${{ steps.meta.outputs.labels }}
53+ tags : ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
54+ outputs : type=docker,push-by-digest=true,name-canonical=true,push=true
55+
56+ # - name: Run tests
57+ # if: github.event_name == 'pull_request'
58+ # shell: bash
59+ # run: |
60+ # docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:latest bash -c " \
61+ # pip install pytest nbmake; \
62+ # find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600; "
63+
4264 - name : Authenticate with GHCR
65+ if : github.event_name != 'pull_request'
4366 id : auth
4467 uses : docker/login-action@v3.6.0
4568 with :
4669 registry : ghcr.io
4770 username : ${{ github.repository_owner }}
4871 password : ${{ secrets.BUILD_TOKEN }}
4972
50- - name : Set up Docker Buildx
51- id : buildx
52- uses : docker/setup-buildx-action@v3.11.1
53-
5473 - name : Build and push by digest
74+ if : github.event_name != 'pull_request'
5575 id : build
5676 uses : docker/build-push-action@v6.18.0
5777 with :
5878 file : ./docker/Dockerfile
59- build-args : |
60- AMBERTOOLS_DL=${{ secrets.AMBERTOOLS_DL }}
6179 platforms : ${{ matrix.platform }}
6280 labels : ${{ steps.meta.outputs.labels }}
6381 tags : ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
6482 outputs : type=image,push-by-digest=true,name-canonical=true,push=true
6583
66- # - name: Test notebooks
84+ # - name: Run tests
85+ # if: github.event_name != 'pull_request'
6786 # shell: bash
6887 # run: |
6988 # docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@${{ steps.build.outputs.digest }} bash -c " \
7089 # pip install pytest nbmake; \
71- # find ./notebooks -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600;"
90+ # find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600; "
7291
7392 - name : Export digest
93+ if : github.event_name != 'pull_request'
7494 run : |
7595 mkdir -p ${{ runner.temp }}/digests
7696 digest="${{ steps.build.outputs.digest }}"
7797 touch "${{ runner.temp }}/digests/${digest#sha256:}"
7898
7999 - name : Upload digest
80- uses : actions/upload-artifact@v4.6.2
100+ if : github.event_name != 'pull_request'
101+ uses : actions/upload-artifact@v5.0.0
81102 with :
82103 name : digests-${{ env.PLATFORM_PAIR }}
83104 path : ${{ runner.temp }}/digests/*
92113 - build
93114 steps :
94115 - name : Download digests
95- uses : actions/download-artifact@v5 .0.0
116+ uses : actions/download-artifact@v6 .0.0
96117 with :
97118 path : ${{ runner.temp }}/digests
98119 pattern : digests-*
0 commit comments