Skip to content

Commit 65e11f2

Browse files
committed
push docker to main
1 parent 7fe12c8 commit 65e11f2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/build-docker-image.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,23 @@ jobs:
4040
username: ${{ secrets.DOCKERHUB_USERNAME }}
4141
password: ${{ secrets.DOCKERHUB_TOKEN }}
4242

43+
- name: Determine Docker tags
44+
id: docker_tags
45+
run: |
46+
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ inputs.tag }}" ]; then
47+
# Manual workflow dispatch with custom tag
48+
echo "tags=opengisch/pum:${{ inputs.tag }}" >> $GITHUB_OUTPUT
49+
elif [ "${{ github.ref_type }}" = "tag" ]; then
50+
# Tag push: use tag name and latest
51+
echo "tags=opengisch/pum:${{ github.ref_name }},opengisch/pum:latest" >> $GITHUB_OUTPUT
52+
else
53+
# Other branches: use branch name
54+
echo "tags=opengisch/pum:${{ github.ref_name }}" >> $GITHUB_OUTPUT
55+
fi
56+
4357
- uses: docker/build-push-action@v6
4458
with:
4559
context: .
4660
file: ./Dockerfile
4761
push: true
48-
tags: opengisch/pum:${{ inputs.tag || github.ref_name != github.event.repository.default_branch && github.ref_name || 'latest' }}
62+
tags: ${{ steps.docker_tags.outputs.tags }}

0 commit comments

Comments
 (0)