add tag prefix for docker images
/ publish (push) Successful in 7s

This commit is contained in:
2026-05-31 19:15:15 -04:00
parent 107f3c70f5
commit 2e9a99fe8f
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -28,6 +28,9 @@ inputs:
TAG_LATEST:
description: "Also tag and push the image as latest"
default: "false"
TAG_PREFIX:
description: "Optional prefix to prepend to IMAGE_TAG (e.g. 'dev' produces 'dev-<tag>'). Does not affect the latest tag."
default: ""
WORKING_DIRECTORY:
description: "Working directory for the Docker build"
default: "."
@@ -51,7 +54,11 @@ runs:
- name: Docker Build and Push
shell: sh
run: |
TAGS="-t ${{ inputs.IMAGE_PATH }}:${{ inputs.IMAGE_TAG }}"
TAG="${{ inputs.IMAGE_TAG }}"
if [ -n "${{ inputs.TAG_PREFIX }}" ]; then
TAG="${{ inputs.TAG_PREFIX }}-${TAG}"
fi
TAGS="-t ${{ inputs.IMAGE_PATH }}:${TAG}"
if [ "${{ inputs.TAG_LATEST }}" = "true" ]; then
TAGS="$TAGS -t ${{ inputs.IMAGE_PATH }}:latest"
fi