@@ -20,6 +20,7 @@ Build a Docker image and push it to the Gitea container registry
|
|||||||
| `ARTIFACT_NAME` | <p>Name of the build artifact to download</p> | `false` | `dist` |
|
| `ARTIFACT_NAME` | <p>Name of the build artifact to download</p> | `false` | `dist` |
|
||||||
| `ARTIFACT_PATH` | <p>Destination path for the downloaded artifact</p> | `false` | `dist` |
|
| `ARTIFACT_PATH` | <p>Destination path for the downloaded artifact</p> | `false` | `dist` |
|
||||||
| `TAG_LATEST` | <p>Also tag and push the image as latest</p> | `false` | `false` |
|
| `TAG_LATEST` | <p>Also tag and push the image as latest</p> | `false` | `false` |
|
||||||
|
| `TAG_PREFIX` | <p>Optional prefix to prepend to IMAGE_TAG (e.g. 'dev' produces 'dev-<tag>'). Does not affect the latest tag.</p> | `false` | `""` |
|
||||||
| `WORKING_DIRECTORY` | <p>Working directory for the Docker build</p> | `false` | `.` |
|
| `WORKING_DIRECTORY` | <p>Working directory for the Docker build</p> | `false` | `.` |
|
||||||
<!-- action-docs-inputs source="action.yml" -->
|
<!-- action-docs-inputs source="action.yml" -->
|
||||||
|
|
||||||
|
|||||||
+8
-1
@@ -28,6 +28,9 @@ inputs:
|
|||||||
TAG_LATEST:
|
TAG_LATEST:
|
||||||
description: "Also tag and push the image as latest"
|
description: "Also tag and push the image as latest"
|
||||||
default: "false"
|
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:
|
WORKING_DIRECTORY:
|
||||||
description: "Working directory for the Docker build"
|
description: "Working directory for the Docker build"
|
||||||
default: "."
|
default: "."
|
||||||
@@ -51,7 +54,11 @@ runs:
|
|||||||
- name: Docker Build and Push
|
- name: Docker Build and Push
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
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
|
if [ "${{ inputs.TAG_LATEST }}" = "true" ]; then
|
||||||
TAGS="$TAGS -t ${{ inputs.IMAGE_PATH }}:latest"
|
TAGS="$TAGS -t ${{ inputs.IMAGE_PATH }}:latest"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user