Skip to content

Commit 5370df2

Browse files
committed
push to ghcr
1 parent 2162cbc commit 5370df2

File tree

1 file changed

+106
-21
lines changed

1 file changed

+106
-21
lines changed

.github/workflows/build_gh_runner_images.yaml

Lines changed: 106 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ defaults:
1414
run:
1515
shell: bash
1616
working-directory: /tmp
17+
permissions:
18+
contents: read
19+
packages: write
1720
#------------------------------------------------------------------------------------#
1821
jobs:
1922
build-push-docker-alpine:
@@ -41,8 +44,8 @@ jobs:
4144
set +x ; set +e
4245
#--------------#
4346
#Docker Tags
44-
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="$DOCKER_TAG"
45-
echo "DOCKER_TAG=$DOCKER_TAG" >> "$GITHUB_ENV"
47+
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="${DOCKER_TAG}"
48+
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}"
4649
#Copy dockerfiles
4750
mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES"
4851
cp "${GITHUB_WORKSPACE}/main/Github/Runners/alpine-builder.dockerfile" "/tmp/DOCKERFILES/alpine-builder.dockerfile"
@@ -63,6 +66,14 @@ jobs:
6366
password: "${{ secrets.DOCKERHUB_TOKEN }}"
6467
continue-on-error: true
6568

69+
- name: Login to GHCR
70+
uses: docker/login-action@v3
71+
with:
72+
registry: ghcr.io
73+
username: "${{ github.actor }}"
74+
password: "${{ secrets.GITHUB_TOKEN }}"
75+
continue-on-error: true
76+
6677
#https://hub.docker.com/r/pkgforge/alpine-builder
6778
- name: Docker Build and Push (alpine-builder)
6879
uses: docker/build-push-action@v6
@@ -73,6 +84,8 @@ jobs:
7384
tags: |
7485
pkgforge/alpine-builder:latest
7586
pkgforge/alpine-builder:${{ env.DOCKER_TAG }}
87+
ghcr.io/pkgforge/alpine-builder:latest
88+
ghcr.io/pkgforge/alpine-builder:${{ env.DOCKER_TAG }}
7689
push: true
7790
continue-on-error: true
7891
#------------------------------------------------------------------------------------#
@@ -101,8 +114,8 @@ jobs:
101114
set +x ; set +e
102115
#--------------#
103116
#Docker Tags
104-
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="$DOCKER_TAG"
105-
echo "DOCKER_TAG=$DOCKER_TAG" >> "$GITHUB_ENV"
117+
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="${DOCKER_TAG}"
118+
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}"
106119
#Copy dockerfiles
107120
mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES"
108121
cp "${GITHUB_WORKSPACE}/main/Github/Runners/archlinux-builder.dockerfile" "/tmp/DOCKERFILES/archlinux-builder.dockerfile"
@@ -123,6 +136,14 @@ jobs:
123136
password: "${{ secrets.DOCKERHUB_TOKEN }}"
124137
continue-on-error: true
125138

139+
- name: Login to GHCR
140+
uses: docker/login-action@v3
141+
with:
142+
registry: ghcr.io
143+
username: "${{ github.actor }}"
144+
password: "${{ secrets.GITHUB_TOKEN }}"
145+
continue-on-error: true
146+
126147
#https://hub.docker.com/r/pkgforge/archlinux-builder
127148
- name: Docker Build and Push (ArchLinux-Builder)
128149
uses: docker/build-push-action@v6
@@ -133,6 +154,8 @@ jobs:
133154
tags: |
134155
pkgforge/archlinux-builder:latest
135156
pkgforge/archlinux-builder:${{ env.DOCKER_TAG }}
157+
ghcr.io/pkgforge/archlinux-builder:latest
158+
ghcr.io/pkgforge/archlinux-builder:${{ env.DOCKER_TAG }}
136159
push: true
137160
continue-on-error: true
138161
#------------------------------------------------------------------------------------#
@@ -162,8 +185,8 @@ jobs:
162185
set +x ; set +e
163186
#--------------#
164187
#Docker Tags
165-
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="$DOCKER_TAG"
166-
echo "DOCKER_TAG=$DOCKER_TAG" >> "$GITHUB_ENV"
188+
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="${DOCKER_TAG}"
189+
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}"
167190
#Copy dockerfiles
168191
mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES"
169192
cp "${GITHUB_WORKSPACE}/main/Github/Runners/ubuntu-systemd-base.dockerfile" "/tmp/DOCKERFILES/ubuntu-systemd-base.dockerfile"
@@ -184,6 +207,14 @@ jobs:
184207
password: "${{ secrets.DOCKERHUB_TOKEN }}"
185208
continue-on-error: true
186209

210+
- name: Login to GHCR
211+
uses: docker/login-action@v3
212+
with:
213+
registry: ghcr.io
214+
username: "${{ github.actor }}"
215+
password: "${{ secrets.GITHUB_TOKEN }}"
216+
continue-on-error: true
217+
187218
#https://hub.docker.com/r/pkgforge/ubuntu-systemd-base
188219
- name: Docker Build and Push (Ubuntu-Systemd-Base)
189220
uses: docker/build-push-action@v6
@@ -192,9 +223,12 @@ jobs:
192223
file: "/tmp/DOCKERFILES/ubuntu-systemd-base.dockerfile"
193224
platforms: "linux/arm64"
194225
tags: |
195-
pkgforge/ubuntu-systemd-base:latest
226+
#pkgforge/ubuntu-systemd-base:latest
196227
pkgforge/ubuntu-systemd-base:aarch64
197-
pkgforge/ubuntu-systemd-base:${{ env.DOCKER_TAG }}
228+
pkgforge/ubuntu-systemd-base:aarch64-${{ env.DOCKER_TAG }}
229+
#ghcr.io/pkgforge/ubuntu-systemd-base:latest
230+
ghcr.io/pkgforge/ubuntu-systemd-base:aarch64
231+
ghcr.io/pkgforge/ubuntu-systemd-base:aarch64-${{ env.DOCKER_TAG }}
198232
push: true
199233
continue-on-error: true
200234
#------------------------------------------------------------------------------------#
@@ -223,8 +257,8 @@ jobs:
223257
set +x ; set +e
224258
#--------------#
225259
#Docker Tags
226-
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="$DOCKER_TAG"
227-
echo "DOCKER_TAG=$DOCKER_TAG" >> "$GITHUB_ENV"
260+
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="${DOCKER_TAG}"
261+
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}"
228262
#Copy dockerfiles
229263
mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES"
230264
cp "${GITHUB_WORKSPACE}/main/Github/Runners/ubuntu-systemd-base.dockerfile" "/tmp/DOCKERFILES/ubuntu-systemd-base.dockerfile"
@@ -245,6 +279,14 @@ jobs:
245279
password: "${{ secrets.DOCKERHUB_TOKEN }}"
246280
continue-on-error: true
247281

282+
- name: Login to GHCR
283+
uses: docker/login-action@v3
284+
with:
285+
registry: ghcr.io
286+
username: "${{ github.actor }}"
287+
password: "${{ secrets.GITHUB_TOKEN }}"
288+
continue-on-error: true
289+
248290
#https://hub.docker.com/r/pkgforge/ubuntu-systemd-base
249291
- name: Docker Build and Push (Ubuntu-Systemd-Base)
250292
uses: docker/build-push-action@v6
@@ -253,9 +295,12 @@ jobs:
253295
file: "/tmp/DOCKERFILES/ubuntu-systemd-base.dockerfile"
254296
platforms: "linux/amd64"
255297
tags: |
256-
pkgforge/ubuntu-systemd-base:latest
298+
#pkgforge/ubuntu-systemd-base:latest
257299
pkgforge/ubuntu-systemd-base:x86_64
258-
pkgforge/ubuntu-systemd-base:${{ env.DOCKER_TAG }}
300+
pkgforge/ubuntu-systemd-base:x86_64-${{ env.DOCKER_TAG }}
301+
#ghcr.io/pkgforge/ubuntu-systemd-base:latest
302+
ghcr.io/pkgforge/ubuntu-systemd-base:x86_64
303+
ghcr.io/pkgforge/ubuntu-systemd-base:x86_64-${{ env.DOCKER_TAG }}
259304
push: true
260305
continue-on-error: true
261306
#------------------------------------------------------------------------------------#
@@ -284,8 +329,8 @@ jobs:
284329
set +x ; set +e
285330
#--------------#
286331
#Docker Tags
287-
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="$DOCKER_TAG"
288-
echo "DOCKER_TAG=$DOCKER_TAG" >> "$GITHUB_ENV"
332+
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="${DOCKER_TAG}"
333+
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}"
289334
#Copy dockerfiles
290335
mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES"
291336
cp "${GITHUB_WORKSPACE}/main/Github/Runners/debian-builder-unstable.dockerfile" "/tmp/DOCKERFILES/debian-builder-unstable.dockerfile"
@@ -306,6 +351,14 @@ jobs:
306351
password: "${{ secrets.DOCKERHUB_TOKEN }}"
307352
continue-on-error: true
308353

354+
- name: Login to GHCR
355+
uses: docker/login-action@v3
356+
with:
357+
registry: ghcr.io
358+
username: "${{ github.actor }}"
359+
password: "${{ secrets.GITHUB_TOKEN }}"
360+
continue-on-error: true
361+
309362
#https://hub.docker.com/r/pkgforge/debian-builder-unstable
310363
- name: Docker Build and Push (Debian-Unstable-Base)
311364
uses: docker/build-push-action@v6
@@ -316,6 +369,8 @@ jobs:
316369
tags: |
317370
pkgforge/debian-builder-unstable:latest
318371
pkgforge/debian-builder-unstable:${{ env.DOCKER_TAG }}
372+
ghcr.io/pkgforge/debian-builder-unstable:latest
373+
ghcr.io/pkgforge/debian-builder-unstable:${{ env.DOCKER_TAG }}
319374
push: true
320375
continue-on-error: true
321376
#------------------------------------------------------------------------------------#
@@ -344,8 +399,8 @@ jobs:
344399
set +x ; set +e
345400
#--------------#
346401
#Docker Tags
347-
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="$DOCKER_TAG"
348-
echo "DOCKER_TAG=$DOCKER_TAG" >> "$GITHUB_ENV"
402+
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="${DOCKER_TAG}"
403+
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}"
349404
#Copy dockerfiles
350405
mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES"
351406
cp "${GITHUB_WORKSPACE}/main/Github/Runners/ubuntu-builder.dockerfile" "/tmp/DOCKERFILES/ubuntu-builder.dockerfile"
@@ -366,6 +421,14 @@ jobs:
366421
password: "${{ secrets.DOCKERHUB_TOKEN }}"
367422
continue-on-error: true
368423

424+
- name: Login to GHCR
425+
uses: docker/login-action@v3
426+
with:
427+
registry: ghcr.io
428+
username: "${{ github.actor }}"
429+
password: "${{ secrets.GITHUB_TOKEN }}"
430+
continue-on-error: true
431+
369432
#https://hub.docker.com/r/pkgforge/ubuntu-builder
370433
- name: Docker Build and Push (ubuntu-builder)
371434
uses: docker/build-push-action@v6
@@ -376,7 +439,9 @@ jobs:
376439
tags: |
377440
pkgforge/ubuntu-builder:latest
378441
pkgforge/ubuntu-builder:${{ env.DOCKER_TAG }}
379-
push: true
442+
ghcr.io/pkgforge/ubuntu-builder:latest
443+
ghcr.io/pkgforge/ubuntu-builder:${{ env.DOCKER_TAG }}
444+
push: true
380445
continue-on-error: true
381446
#------------------------------------------------------------------------------------#
382447
build-push-docker-runner-aarch64:
@@ -404,8 +469,8 @@ jobs:
404469
set +x ; set +e
405470
#--------------#
406471
#Docker Tags
407-
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="$DOCKER_TAG"
408-
echo "DOCKER_TAG=$DOCKER_TAG" >> "$GITHUB_ENV"
472+
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="${DOCKER_TAG}"
473+
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}"
409474
#Copy dockerfiles
410475
mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES"
411476
cp "${GITHUB_WORKSPACE}/main/Github/Runners/aarch64-ubuntu.dockerfile" "/tmp/DOCKERFILES/aarch64-ubuntu.dockerfile"
@@ -427,6 +492,14 @@ jobs:
427492
password: "${{ secrets.DOCKERHUB_TOKEN }}"
428493
continue-on-error: true
429494

495+
- name: Login to GHCR
496+
uses: docker/login-action@v3
497+
with:
498+
registry: ghcr.io
499+
username: "${{ github.actor }}"
500+
password: "${{ secrets.GITHUB_TOKEN }}"
501+
continue-on-error: true
502+
430503
#https://hub.docker.com/r/pkgforge/gh-runner-aarch64-ubuntu
431504
- name: Docker Build and Push (gh-runner-aarch64-ubuntu)
432505
uses: docker/build-push-action@v6
@@ -438,6 +511,8 @@ jobs:
438511
tags: |
439512
pkgforge/gh-runner-aarch64-ubuntu:latest
440513
pkgforge/gh-runner-aarch64-ubuntu:${{ env.DOCKER_TAG }}
514+
ghcr.io/pkgforge/gh-runner-aarch64-ubuntu:latest
515+
ghcr.io/pkgforge/gh-runner-aarch64-ubuntu:${{ env.DOCKER_TAG }}
441516
push: true
442517
continue-on-error: true
443518
#------------------------------------------------------------------------------------#
@@ -466,8 +541,8 @@ jobs:
466541
set +x ; set +e
467542
#--------------#
468543
#Docker Tags
469-
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="$DOCKER_TAG"
470-
echo "DOCKER_TAG=$DOCKER_TAG" >> "$GITHUB_ENV"
544+
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="${DOCKER_TAG}"
545+
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}"
471546
#Copy dockerfiles
472547
mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES"
473548
cp "${GITHUB_WORKSPACE}/main/Github/Runners/x86_64-ubuntu.dockerfile" "/tmp/DOCKERFILES/x86_64-ubuntu.dockerfile"
@@ -489,6 +564,14 @@ jobs:
489564
password: "${{ secrets.DOCKERHUB_TOKEN }}"
490565
continue-on-error: true
491566

567+
- name: Login to GHCR
568+
uses: docker/login-action@v3
569+
with:
570+
registry: ghcr.io
571+
username: "${{ github.actor }}"
572+
password: "${{ secrets.GITHUB_TOKEN }}"
573+
continue-on-error: true
574+
492575
#https://hub.docker.com/r/pkgforge/gh-runner-x86_64-ubuntu
493576
- name: Docker Build and Push (gh-runner-x86_64-ubuntu)
494577
uses: docker/build-push-action@v6
@@ -500,6 +583,8 @@ jobs:
500583
tags: |
501584
pkgforge/gh-runner-x86_64-ubuntu:latest
502585
pkgforge/gh-runner-x86_64-ubuntu:${{ env.DOCKER_TAG }}
586+
ghcr.io/pkgforge/gh-runner-x86_64-ubuntu:latest
587+
ghcr.io/pkgforge/gh-runner-x86_64-ubuntu:${{ env.DOCKER_TAG }}
503588
push: true
504589
continue-on-error: true
505590
#------------------------------------------------------------------------------------#

0 commit comments

Comments
 (0)