Skip to content
This repository was archived by the owner on May 5, 2026. It is now read-only.

Commit d98aed1

Browse files
Add GHCR tagging to Docker image workflows
Updated both dev and prod GitHub Actions workflows to tag Docker images with the GitHub Container Registry (GHCR) path before pushing. This ensures images are correctly named and accessible in GHCR.
1 parent 24077ad commit d98aed1

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/Build-Docker-Dev-image.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
required: true
1111
default: "1.0.0"
1212

13+
permissions:
14+
contents: write
15+
packages: write
16+
1317
jobs:
1418

1519
build:
@@ -38,11 +42,14 @@ jobs:
3842
- name: Build Docker Image
3943
run: |
4044
docker build -t $IMAGE_NAME:${VERSION}-dev .
45+
echo "GHCR_IMAGE=ghcr.io/toolshive/intrudex" >> $GITHUB_ENV
4146
4247
- name: Push Docker Image
4348
run: |
4449
docker push $IMAGE_NAME:${VERSION}-dev
4550
4651
- name: Push to GitHub Container Registry
4752
run: |
53+
docker tag $IMAGE_NAME:${VERSION}-dev $GHCR_IMAGE:${VERSION}-dev
54+
docker push $GHCR_IMAGE:${VERSION}-dev
4855
docker push $GHCR_IMAGE:${VERSION}-dev

.github/workflows/Build-Docker-Prod-image.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
required: true
1111
default: "1.0.0"
1212

13+
permissions:
14+
contents: write
15+
packages: write
16+
1317
jobs:
1418

1519
build:
@@ -38,11 +42,13 @@ jobs:
3842
- name: Build Docker Image
3943
run: |
4044
docker build -f Dockerfile.prod -t $IMAGE_NAME:${VERSION}-prod .
45+
echo "GHCR_IMAGE=ghcr.io/toolshive/intrudex" >> $GITHUB_ENV
4146
4247
- name: Push Docker Image
4348
run: |
4449
docker push $IMAGE_NAME:${VERSION}-prod
4550
4651
- name: Push to GitHub Container Registry
4752
run: |
53+
docker tag $IMAGE_NAME:${VERSION}-prod $GHCR_IMAGE:${VERSION}-prod
4854
docker push $GHCR_IMAGE:${VERSION}-prod

0 commit comments

Comments
 (0)