Skip to content

Commit 31b6086

Browse files
Copilotalessfg
andcommitted
Complete local registry image sharing implementation for all workflows
Co-authored-by: alessfg <[email protected]>
1 parent 6e4f6e1 commit 31b6086

File tree

2 files changed

+50
-5
lines changed

2 files changed

+50
-5
lines changed

.github/workflows/debian-mainline.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ jobs:
4242
image: registry:2
4343
ports:
4444
- 5000:5000
45+
services:
46+
registry:
47+
image: registry:2
48+
ports:
49+
- 5000:5000
4550
steps:
4651
- name: Check out the codebase
4752
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -99,6 +104,7 @@ jobs:
99104
public.ecr.aws/nginx/nginx-unprivileged
100105
quay.io/nginx/nginx-unprivileged
101106
${{ github.event_name == 'pull_request' && 'localhost:5000/nginx-unprivileged' || '' }}
107+
${{ github.event_name == 'pull_request' && 'localhost:5000/nginx-unprivileged' || '' }}
102108
tags: |
103109
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}
104110
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-${{ needs.version.outputs.distro }}
@@ -162,6 +168,16 @@ jobs:
162168
runs-on: ubuntu-24.04
163169
strategy:
164170
fail-fast: false
171+
services:
172+
registry:
173+
image: registry:2
174+
ports:
175+
- 5000:5000
176+
services:
177+
registry:
178+
image: registry:2
179+
ports:
180+
- 5000:5000
165181
steps:
166182
- name: Check out the codebase
167183
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -218,6 +234,7 @@ jobs:
218234
ghcr.io/nginx/nginx-unprivileged
219235
public.ecr.aws/nginx/nginx-unprivileged
220236
quay.io/nginx/nginx-unprivileged
237+
${{ github.event_name == 'pull_request' && 'localhost:5000/nginx-unprivileged' || '' }}
221238
tags: |
222239
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-perl
223240
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-${{ needs.version.outputs.distro }}-perl
@@ -242,9 +259,10 @@ jobs:
242259
labels: ${{ steps.meta.outputs.labels }}
243260
annotations: ${{ steps.meta.outputs.annotations }}
244261
tags: ${{ steps.meta.outputs.tags }}
245-
push: ${{ github.event_name != 'pull_request' }}
262+
push: true
246263
cache-from: type=gha,scope=debian-perl
247264
cache-to: type=gha,mode=min,scope=debian-perl
265+
build-args: ${{ github.event_name == 'pull_request' && 'IMAGE=localhost:5000/nginx-unprivileged:latest' || '' }}
248266

249267
- name: Sign Docker Hub Manifest
250268
if: ${{ github.event_name != 'pull_request' }}
@@ -281,6 +299,11 @@ jobs:
281299
runs-on: ubuntu-24.04
282300
strategy:
283301
fail-fast: false
302+
services:
303+
registry:
304+
image: registry:2
305+
ports:
306+
- 5000:5000
284307
steps:
285308
- name: Check out the codebase
286309
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -337,6 +360,7 @@ jobs:
337360
ghcr.io/nginx/nginx-unprivileged
338361
public.ecr.aws/nginx/nginx-unprivileged
339362
quay.io/nginx/nginx-unprivileged
363+
${{ github.event_name == 'pull_request' && 'localhost:5000/nginx-unprivileged' || '' }}
340364
tags: |
341365
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-otel
342366
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-${{ needs.version.outputs.distro }}-otel
@@ -360,9 +384,10 @@ jobs:
360384
labels: ${{ steps.meta.outputs.labels }}
361385
annotations: ${{ steps.meta.outputs.annotations }}
362386
tags: ${{ steps.meta.outputs.tags }}
363-
push: ${{ github.event_name != 'pull_request' }}
387+
push: true
364388
cache-from: type=gha,scope=debian-otel
365389
cache-to: type=gha,mode=min,scope=debian-otel
390+
build-args: ${{ github.event_name == 'pull_request' && 'IMAGE=localhost:5000/nginx-unprivileged:latest' || '' }}
366391

367392
- name: Sign Docker Hub Manifest
368393
if: ${{ github.event_name != 'pull_request' }}

.github/workflows/debian-stable.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ jobs:
3737
runs-on: ubuntu-24.04
3838
strategy:
3939
fail-fast: false
40+
services:
41+
registry:
42+
image: registry:2
43+
ports:
44+
- 5000:5000
4045
steps:
4146
- name: Check out the codebase
4247
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -93,6 +98,7 @@ jobs:
9398
ghcr.io/nginx/nginx-unprivileged
9499
public.ecr.aws/nginx/nginx-unprivileged
95100
quay.io/nginx/nginx-unprivileged
101+
${{ github.event_name == 'pull_request' && 'localhost:5000/nginx-unprivileged' || '' }}
96102
tags: |
97103
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}
98104
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-${{ needs.version.outputs.distro }}
@@ -113,7 +119,7 @@ jobs:
113119
labels: ${{ steps.meta.outputs.labels }}
114120
annotations: ${{ steps.meta.outputs.annotations }}
115121
tags: ${{ steps.meta.outputs.tags }}
116-
push: ${{ github.event_name != 'pull_request' }}
122+
push: true
117123
cache-from: type=gha,scope=stable-debian
118124
cache-to: type=gha,mode=min,scope=stable-debian
119125

@@ -148,6 +154,11 @@ jobs:
148154
runs-on: ubuntu-24.04
149155
strategy:
150156
fail-fast: false
157+
services:
158+
registry:
159+
image: registry:2
160+
ports:
161+
- 5000:5000
151162
steps:
152163
- name: Check out the codebase
153164
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -204,6 +215,7 @@ jobs:
204215
ghcr.io/nginx/nginx-unprivileged
205216
public.ecr.aws/nginx/nginx-unprivileged
206217
quay.io/nginx/nginx-unprivileged
218+
${{ github.event_name == 'pull_request' && 'localhost:5000/nginx-unprivileged' || '' }}
207219
tags: |
208220
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-perl
209221
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-${{ needs.version.outputs.distro }}-perl
@@ -224,9 +236,10 @@ jobs:
224236
labels: ${{ steps.meta.outputs.labels }}
225237
annotations: ${{ steps.meta.outputs.annotations }}
226238
tags: ${{ steps.meta.outputs.tags }}
227-
push: ${{ github.event_name != 'pull_request' }}
239+
push: true
228240
cache-from: type=gha,scope=stable-debian-perl
229241
cache-to: type=gha,mode=min,scope=stable-debian-perl
242+
build-args: ${{ github.event_name == 'pull_request' && 'IMAGE=localhost:5000/nginx-unprivileged:stable' || '' }}
230243

231244
- name: Sign Docker Hub Manifest
232245
if: ${{ github.event_name != 'pull_request' }}
@@ -259,6 +272,11 @@ jobs:
259272
runs-on: ubuntu-24.04
260273
strategy:
261274
fail-fast: false
275+
services:
276+
registry:
277+
image: registry:2
278+
ports:
279+
- 5000:5000
262280
steps:
263281
- name: Check out the codebase
264282
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -315,6 +333,7 @@ jobs:
315333
ghcr.io/nginx/nginx-unprivileged
316334
public.ecr.aws/nginx/nginx-unprivileged
317335
quay.io/nginx/nginx-unprivileged
336+
${{ github.event_name == 'pull_request' && 'localhost:5000/nginx-unprivileged' || '' }}
318337
tags: |
319338
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-otel
320339
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-${{ needs.version.outputs.distro }}-otel
@@ -334,9 +353,10 @@ jobs:
334353
labels: ${{ steps.meta.outputs.labels }}
335354
annotations: ${{ steps.meta.outputs.annotations }}
336355
tags: ${{ steps.meta.outputs.tags }}
337-
push: ${{ github.event_name != 'pull_request' }}
356+
push: true
338357
cache-from: type=gha,scope=stable-debian-otel
339358
cache-to: type=gha,mode=min,scope=stable-debian-otel
359+
build-args: ${{ github.event_name == 'pull_request' && 'IMAGE=localhost:5000/nginx-unprivileged:stable' || '' }}
340360

341361
- name: Sign Docker Hub Manifest
342362
if: ${{ github.event_name != 'pull_request' }}

0 commit comments

Comments
 (0)