Skip to content

Commit 6e4f6e1

Browse files
Copilotalessfg
andcommitted
Add local registry image sharing to Alpine stable workflow
Co-authored-by: alessfg <[email protected]>
1 parent 5323954 commit 6e4f6e1

File tree

2 files changed

+38
-5
lines changed

2 files changed

+38
-5
lines changed

.github/workflows/alpine-stable.yml

Lines changed: 31 additions & 4 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 }}-alpine-slim
98104
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine${{ needs.version.outputs.distro }}-slim
@@ -112,7 +118,7 @@ jobs:
112118
labels: ${{ steps.meta.outputs.labels }}
113119
annotations: ${{ steps.meta.outputs.annotations }}
114120
tags: ${{ steps.meta.outputs.tags }}
115-
push: ${{ github.event_name != 'pull_request' }}
121+
push: true
116122
cache-from: type=gha,scope=stable-alpine-slim
117123
cache-to: type=gha,mode=min,scope=stable-alpine-slim
118124

@@ -147,6 +153,11 @@ jobs:
147153
runs-on: ubuntu-24.04
148154
strategy:
149155
fail-fast: false
156+
services:
157+
registry:
158+
image: registry:2
159+
ports:
160+
- 5000:5000
150161
steps:
151162
- name: Check out the codebase
152163
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -203,6 +214,7 @@ jobs:
203214
ghcr.io/nginx/nginx-unprivileged
204215
public.ecr.aws/nginx/nginx-unprivileged
205216
quay.io/nginx/nginx-unprivileged
217+
${{ github.event_name == 'pull_request' && 'localhost:5000/nginx-unprivileged' || '' }}
206218
tags: |
207219
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine
208220
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine${{ needs.version.outputs.distro }}
@@ -222,9 +234,10 @@ jobs:
222234
labels: ${{ steps.meta.outputs.labels }}
223235
annotations: ${{ steps.meta.outputs.annotations }}
224236
tags: ${{ steps.meta.outputs.tags }}
225-
push: ${{ github.event_name != 'pull_request' }}
237+
push: true
226238
cache-from: type=gha,scope=stable-alpine
227239
cache-to: type=gha,mode=min,scope=stable-alpine
240+
build-args: ${{ github.event_name == 'pull_request' && 'IMAGE=localhost:5000/nginx-unprivileged:stable-alpine-slim' || '' }}
228241

229242
- name: Sign Docker Hub Manifest
230243
if: ${{ github.event_name != 'pull_request' }}
@@ -257,6 +270,11 @@ jobs:
257270
runs-on: ubuntu-24.04
258271
strategy:
259272
fail-fast: false
273+
services:
274+
registry:
275+
image: registry:2
276+
ports:
277+
- 5000:5000
260278
steps:
261279
- name: Check out the codebase
262280
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -313,6 +331,7 @@ jobs:
313331
ghcr.io/nginx/nginx-unprivileged
314332
public.ecr.aws/nginx/nginx-unprivileged
315333
quay.io/nginx/nginx-unprivileged
334+
${{ github.event_name == 'pull_request' && 'localhost:5000/nginx-unprivileged' || '' }}
316335
tags: |
317336
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine-perl
318337
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine${{ needs.version.outputs.distro }}-perl
@@ -332,9 +351,10 @@ jobs:
332351
labels: ${{ steps.meta.outputs.labels }}
333352
annotations: ${{ steps.meta.outputs.annotations }}
334353
tags: ${{ steps.meta.outputs.tags }}
335-
push: ${{ github.event_name != 'pull_request' }}
354+
push: true
336355
cache-from: type=gha,scope=stable-alpine-perl
337356
cache-to: type=gha,mode=min,scope=stable-alpine-perl
357+
build-args: ${{ github.event_name == 'pull_request' && 'IMAGE=localhost:5000/nginx-unprivileged:stable-alpine' || '' }}
338358

339359
- name: Sign Docker Hub Manifest
340360
if: ${{ github.event_name != 'pull_request' }}
@@ -366,6 +386,11 @@ jobs:
366386
runs-on: ubuntu-24.04
367387
strategy:
368388
fail-fast: false
389+
services:
390+
registry:
391+
image: registry:2
392+
ports:
393+
- 5000:5000
369394
steps:
370395
- name: Check out the codebase
371396
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -422,6 +447,7 @@ jobs:
422447
ghcr.io/nginx/nginx-unprivileged
423448
public.ecr.aws/nginx/nginx-unprivileged
424449
quay.io/nginx/nginx-unprivileged
450+
${{ github.event_name == 'pull_request' && 'localhost:5000/nginx-unprivileged' || '' }}
425451
tags: |
426452
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine-otel
427453
type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine${{ needs.version.outputs.distro }}-otel
@@ -441,9 +467,10 @@ jobs:
441467
labels: ${{ steps.meta.outputs.labels }}
442468
annotations: ${{ steps.meta.outputs.annotations }}
443469
tags: ${{ steps.meta.outputs.tags }}
444-
push: ${{ github.event_name != 'pull_request' }}
470+
push: true
445471
cache-from: type=gha,scope=stable-alpine-otel
446472
cache-to: type=gha,mode=min,scope=stable-alpine-otel
473+
build-args: ${{ github.event_name == 'pull_request' && 'IMAGE=localhost:5000/nginx-unprivileged:stable-alpine' || '' }}
447474

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

.github/workflows/debian-mainline.yml

Lines changed: 7 additions & 1 deletion
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 }}
@@ -117,7 +123,7 @@ jobs:
117123
labels: ${{ steps.meta.outputs.labels }}
118124
annotations: ${{ steps.meta.outputs.annotations }}
119125
tags: ${{ steps.meta.outputs.tags }}
120-
push: ${{ github.event_name != 'pull_request' }}
126+
push: true
121127
cache-from: type=gha,scope=debian
122128
cache-to: type=gha,mode=min,scope=debian
123129

0 commit comments

Comments
 (0)