Skip to content

Commit 2a2eddb

Browse files
authored
Update build.yaml
1 parent a8dcbfa commit 2a2eddb

1 file changed

Lines changed: 32 additions & 9 deletions

File tree

.github/workflows/build.yaml

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
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,19 +39,39 @@ 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:
@@ -61,21 +81,24 @@ jobs:
6181
tags: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
6282
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
6383

64-
#- name: Test notebooks
84+
#- name: Run tests
85+
# if: github.event_name != 'pull_request'
6586
# shell: bash
6687
# run: |
6788
# docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@${{ steps.build.outputs.digest }} bash -c " \
6889
# pip install pytest nbmake; \
69-
# find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600;"
90+
# find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600; "
7091

7192
- name: Export digest
93+
if: github.event_name != 'pull_request'
7294
run: |
7395
mkdir -p ${{ runner.temp }}/digests
7496
digest="${{ steps.build.outputs.digest }}"
7597
touch "${{ runner.temp }}/digests/${digest#sha256:}"
7698
7799
- name: Upload digest
78-
uses: actions/upload-artifact@v4.6.2
100+
if: github.event_name != 'pull_request'
101+
uses: actions/upload-artifact@v5.0.0
79102
with:
80103
name: digests-${{ env.PLATFORM_PAIR }}
81104
path: ${{ runner.temp }}/digests/*
@@ -90,7 +113,7 @@ jobs:
90113
- build
91114
steps:
92115
- name: Download digests
93-
uses: actions/download-artifact@v5.0.0
116+
uses: actions/download-artifact@v6.0.0
94117
with:
95118
path: ${{ runner.temp }}/digests
96119
pattern: digests-*

0 commit comments

Comments
 (0)