Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,39 @@ jobs:
with:
images: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3.11.1

- name: Build and push by digest
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v6.18.0
with:
file: ./docker/Dockerfile
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
outputs: type=docker,push-by-digest=true,name-canonical=true,push=true

- name: Run tests
if: github.event_name == 'pull_request'
shell: bash
run: |
docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:latest bash -c " \
pip install pytest nbmake; \
find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600 --ignore=answers; "

- name: Authenticate with GHCR
if: github.event_name != 'pull_request'
id: auth
uses: docker/login-action@v3.6.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.BUILD_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3.11.1

- name: Build and push by digest
if: github.event_name != 'pull_request'
id: build
uses: docker/build-push-action@v6.18.0
with:
Expand All @@ -61,20 +81,23 @@ jobs:
tags: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
outputs: type=image,push-by-digest=true,name-canonical=true,push=true

- name: Test notebooks
- name: Run tests
if: github.event_name != 'pull_request'
shell: bash
run: |
docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@${{ steps.build.outputs.digest }} bash -c " \
pip install pytest nbmake; \
find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600 --ignore=answers; "

- name: Export digest
if: github.event_name != 'pull_request'
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"

- name: Upload digest
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v5.0.0
with:
name: digests-${{ env.PLATFORM_PAIR }}
Expand Down