1212 IMAGE_VERSION_PREFIX : ts
1313
1414jobs :
15- release-ts :
16- if : ${{ github.event_name == 'pull_request' || ( github.event_name == 'release' && startsWith( github.ref, 'refs/tags/ts') ) }}
15+ release-ts-amd64 :
16+ if : ${{ ( github.event_name == 'pull_request' && contains(github.event.head_commit.message, '#ts') ) || ( github.event_name == 'release' && startsWith( github.ref, 'refs/tags/ts') ) }}
1717 runs-on : ubuntu-latest
1818 strategy :
1919 matrix :
2020 platform :
2121 - linux/amd64
22- - linux/arm64
2322 steps :
2423 - name : Prepare
2524 run : |
@@ -34,10 +33,65 @@ jobs:
3433 with :
3534 images : ${{ env.REGISTRY_IMAGE }}
3635
37- - # Add QEMU to allow building non-native containers as
38- # part of multi-platform container builds.
39- name : Set up QEMU
40- uses : docker/setup-qemu-action@v3
36+ - # Setup buildx so we can do multi-platform container builds.
37+ name : Set up Docker Buildx
38+ uses : docker/setup-buildx-action@v3
39+
40+ - name : Login to GHCR
41+ if : ${{ github.event_name != 'pull_request' && !github.event.release.prerelease}}
42+ uses : docker/login-action@v3
43+ with :
44+ registry : ghcr.io
45+ username : ${{ github.repository_owner }}
46+ password : ${{ secrets.GITHUB_TOKEN }}
47+
48+ - name : Build and push by digest
49+ id : build
50+ uses : docker/build-push-action@v5
51+ with :
52+ context : toolshed
53+ platforms : ${{ matrix.platform }}
54+ labels : ${{ steps.meta.outputs.labels }}
55+ tags : ${{ steps.meta.outputs.tags }}
56+ annotations : ${{ steps.meta.outputs.annotations }}
57+ outputs : type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ (github.event_name != 'pull_request' && !github.event.release.prerelease) && 'true' || 'false' }}
58+
59+ - name : Export digest
60+ if : ${{ github.event_name != 'pull_request' && !github.event.release.prerelease}}
61+ run : |
62+ mkdir -p /tmp/digests
63+ digest="${{ steps.build.outputs.digest }}"
64+ touch "/tmp/digests/${digest#sha256:}"
65+
66+ - name : Upload digest
67+ if : ${{ github.event_name != 'pull_request' && !github.event.release.prerelease }}
68+ uses : actions/upload-artifact@v4
69+ with :
70+ name : digests-${{ env.PLATFORM_PAIR }}
71+ path : /tmp/digests/*
72+ if-no-files-found : error
73+ retention-days : 1
74+
75+ release-ts-arm64 :
76+ if : ${{ ( github.event_name == 'pull_request' && contains(github.event.head_commit.message, '#ts') ) || ( github.event_name == 'release' && startsWith( github.ref, 'refs/tags/ts') ) }}
77+ runs-on : ubuntu-24.04-arm
78+ strategy :
79+ matrix :
80+ platform :
81+ - linux/arm64
82+ steps :
83+ - name : Prepare
84+ run : |
85+ platform=${{ matrix.platform }}
86+ echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
87+
88+ - uses : actions/checkout@v4
89+
90+ - name : Docker meta
91+ id : meta
92+ uses : docker/metadata-action@v5
93+ with :
94+ images : ${{ env.REGISTRY_IMAGE }}
4195
4296 - # Setup buildx so we can do multi-platform container builds.
4397 name : Set up Docker Buildx
58112 context : toolshed
59113 platforms : ${{ matrix.platform }}
60114 labels : ${{ steps.meta.outputs.labels }}
115+ tags : ${{ steps.meta.outputs.tags }}
116+ annotations : ${{ steps.meta.outputs.annotations }}
61117 outputs : type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ (github.event_name != 'pull_request' && !github.event.release.prerelease) && 'true' || 'false' }}
62118
63119 - name : Export digest
0 commit comments