88 branches :
99 - main
1010
11+ env :
12+ IMAGE_NAME : podmortem-log-parser
13+ DOCKERFILE : ./src/main/docker/Dockerfile.native
14+ DEP_STAGE : dependencies
15+
1116jobs :
1217 warm-cache :
1318 name : Warm Dependencies Cache
14- runs-on : self-hosted
19+ runs-on : [ self-hosted, linux]
1520 permissions :
1621 contents : read
1722 packages : write
@@ -34,16 +39,16 @@ jobs:
3439 uses : docker/build-push-action@v6
3540 with :
3641 context : .
37- file : ./src/main/docker/Dockerfile.native
38- target : dependencies
42+ file : ${{ env.DOCKERFILE }}
43+ target : ${{ env.DEP_STAGE }}
3944 platforms : linux/amd64
4045 push : ${{ github.event_name == 'push' }}
4146 cache-from : type=gha,scope=deps
4247 cache-to : |
4348 type=gha,mode=max,scope=deps
44- ${{ github.event_name == 'push' && format('type=registry,ref=ghcr.io/{0}/podmortem-log-parser :deps-cache,mode=max', github.repository_owner) || '' }}
49+ ${{ github.event_name == 'push' && format('type=registry,ref=ghcr.io/{0}/{1} :deps-cache,mode=max', github.repository_owner, env.IMAGE_NAME ) || '' }}
4550 tags : |
46- ${{ github.event_name == 'push' && format('ghcr.io/{0}/podmortem-log-parser :deps-cache', github.repository_owner) || '' }}
51+ ${{ github.event_name == 'push' && format('ghcr.io/{0}/{1} :deps-cache', github.repository_owner, env.IMAGE_NAME ) || '' }}
4752 build-args : |
4853 GITHUB_USER=${{ github.actor }}
4954 secrets : |
5358 name : Test Build
5459 if : github.event_name == 'pull_request'
5560 needs : warm-cache
56- runs-on : self-hosted
61+ runs-on : [ self-hosted, linux]
5762 steps :
5863 - name : Checkout repository
5964 uses : actions/checkout@v4
6570 uses : docker/build-push-action@v6
6671 with :
6772 context : .
68- file : ./src/main/docker/Dockerfile.native
73+ file : ${{ env.DOCKERFILE }}
6974 platforms : linux/amd64
7075 push : false
7176 cache-from : |
@@ -81,18 +86,19 @@ jobs:
8186 name : Build ${{ matrix.arch }}
8287 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
8388 needs : warm-cache
84- runs-on : self-hosted
89+ runs-on : ${{ matrix.runner }}
8590 permissions :
8691 contents : read
8792 packages : write
8893 strategy :
8994 matrix :
90- arch : [amd64, arm64]
9195 include :
9296 - arch : amd64
9397 platform : linux/amd64
98+ runner : [self-hosted, linux]
9499 - arch : arm64
95100 platform : linux/arm64
101+ runner : ubuntu-22.04-arm
96102 steps :
97103 - name : Checkout repository
98104 uses : actions/checkout@v4
@@ -111,15 +117,15 @@ jobs:
111117 uses : docker/build-push-action@v6
112118 with :
113119 context : .
114- file : ./src/main/docker/Dockerfile.native
120+ file : ${{ env.DOCKERFILE }}
115121 platforms : ${{ matrix.platform }}
116122 push : true
117123 cache-from : |
118124 type=gha,scope=deps
119125 type=gha,scope=build-${{ matrix.arch }}
120- cache-to : type=gha,mode=max,scope=build-${{ matrix.arch }}
126+ cache-to : type=gha,mode=max,scope=build-amd64
121127 tags : |
122- ghcr.io/${{ github.repository_owner }}/podmortem-log-parser :${{ github.sha }}-${{ matrix.arch }}
128+ ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} :${{ github.sha }}-${{ matrix.arch }}
123129 build-args : |
124130 GITHUB_USER=${{ github.actor }}
125131 secrets : |
@@ -129,7 +135,7 @@ jobs:
129135 name : Create Multi-Arch Manifest
130136 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
131137 needs : build-arch
132- runs-on : self-hosted
138+ runs-on : [ self-hosted, linux]
133139 permissions :
134140 contents : read
135141 packages : write
@@ -143,10 +149,10 @@ jobs:
143149
144150 - name : Create and push multi-arch manifest
145151 run : |
146- docker buildx imagetools create -t ghcr.io/${{ github.repository_owner }}/podmortem-log-parser :latest \
147- ghcr.io/${{ github.repository_owner }}/podmortem-log-parser :${{ github.sha }}-amd64 \
148- ghcr.io/${{ github.repository_owner }}/podmortem-log-parser :${{ github.sha }}-arm64
152+ docker buildx imagetools create -t ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} :latest \
153+ ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} :${{ github.sha }}-amd64 \
154+ ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} :${{ github.sha }}-arm64
149155
150- docker buildx imagetools create -t ghcr.io/${{ github.repository_owner }}/podmortem-log-parser :${{ github.sha }} \
151- ghcr.io/${{ github.repository_owner }}/podmortem-log-parser :${{ github.sha }}-amd64 \
152- ghcr.io/${{ github.repository_owner }}/podmortem-log-parser :${{ github.sha }}-arm64
156+ docker buildx imagetools create -t ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} :${{ github.sha }} \
157+ ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} :${{ github.sha }}-amd64 \
158+ ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} :${{ github.sha }}-arm64
0 commit comments