12
12
IMAGE_VERSION_PREFIX : ts
13
13
14
14
jobs :
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') ) }}
17
17
runs-on : ubuntu-latest
18
18
strategy :
19
19
matrix :
20
20
platform :
21
21
- linux/amd64
22
- - linux/arm64
23
22
steps :
24
23
- name : Prepare
25
24
run : |
@@ -34,10 +33,65 @@ jobs:
34
33
with :
35
34
images : ${{ env.REGISTRY_IMAGE }}
36
35
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 }}
41
95
42
96
- # Setup buildx so we can do multi-platform container builds.
43
97
name : Set up Docker Buildx
58
112
context : toolshed
59
113
platforms : ${{ matrix.platform }}
60
114
labels : ${{ steps.meta.outputs.labels }}
115
+ tags : ${{ steps.meta.outputs.tags }}
116
+ annotations : ${{ steps.meta.outputs.annotations }}
61
117
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' }}
62
118
63
119
- name : Export digest
0 commit comments