Skip to content

Commit

Permalink
Update publish-docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mauvehed authored May 24, 2024
1 parent 36a7553 commit 02bb3ea
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 @@ -13,6 +13,8 @@ on:
description: 'Docker image tag'
required: true
default: 'nightly'
release:
types: [published]

jobs:
build-and-publish:
Expand Down Expand Up @@ -41,6 +43,8 @@ jobs:
TAG="${{ github.event.client_payload.tag }}"
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
TAG="${{ github.event.inputs.tag }}"
elif [ "${{ github.event_name }}" == "release" ]; then
TAG="latest"
elif [ "${{ github.event_name }}" == "push" ]; then
if [[ "${{ github.event.head_commit.message }}" == *"Update publish-docker-image.yml"* ]]; then
TAG="test"
Expand All @@ -62,7 +66,7 @@ jobs:
run: |
docker buildx build \
--tag ghcr.io/${{ github.repository_owner }}/yourip:${TAG} \
--tag ghcr.io/${{ github.repository_owner }}/yourip:latest \
$(if [ "$TAG" = "latest" ]; then echo "--tag ghcr.io/${{ github.repository_owner }}/yourip:latest"; fi) \
--push .
- name: Logout from GHCR
Expand Down

0 comments on commit 02bb3ea

Please sign in to comment.