Skip to content

Commit

Permalink
ci(publish-docker-image.yml): add support for building and pushing a …
Browse files Browse the repository at this point in the history
…test image based on the TAG value

The workflow file now includes a conditional statement to build and push a test image to the GitHub Container Registry (GHCR) when the TAG value is set to "test". This enhancement allows for better testing and validation of the application in a separate environment before deploying to production.
  • Loading branch information
mauvehed committed May 24, 2024
1 parent 7d37fc7 commit 666ca42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
paths:
- 'Dockerfile'
- '.github/workflows/publish-docker-image.yml'
repository_dispatch:
types: [publish-docker-image]
workflow_dispatch:
Expand Down Expand Up @@ -46,12 +47,15 @@ jobs:
docker buildx build \
--tag ghcr.io/${{ github.repository_owner }}/yourip:nightly \
--push .
elif [ "${TAG}" = "test" ]; then
docker buildx build \
--tag ghcr.io/${{ github.repository_owner }}/yourip:test \
--push .
else
docker buildx build \
--tag ghcr.io/${{ github.repository_owner }}/yourip:${TAG} \
--tag ghcr.io/${{ github.repository_owner }}/yourip:latest \
--push .
fi
- name: Logout from GHCR
run: docker logout ghcr.io

0 comments on commit 666ca42

Please sign in to comment.