Skip to content

Commit

Permalink
support defining custom tag (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
askvinni authored Jun 28, 2024
1 parent 3ef5af0 commit 05a3c2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
| `docker-registry` | Docker Registry | `staffbase.jfrog.io` |
| `docker-registry-api` | Docker Registry API (used for retagging without pulling) | `https://staffbase.jfrog.io/artifactory/api/docker/` |
| `docker-image` | Docker Image | |
| `docker-custom-tag` | Docker Custom Tag to be set on the image | |
| `docker-username` | Username for the Docker Registry | |
| `docker-password` | Password for the Docker Registry | |
| `docker-file` | Dockerfile | `./Dockerfile` |
Expand Down
10 changes: 9 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ inputs:
docker-image:
description: 'Docker Image'
required: true
docker-custom-tag:
description: 'Docker Custom Tag'
required: false
docker-username:
description: 'Username for the Docker Registry'
required: false
Expand Down Expand Up @@ -90,7 +93,12 @@ runs:
shell: bash
run: |
BUILD="true"
if [[ $GITHUB_REF == refs/heads/master ]]; then
if [[ -n "${{ inputs.docker-custom-tag }}" ]]; then
TAG="${{ inputs.docker-custom-tag }}"
LATEST="latest"
PUSH="true"
BUILD="${{ inputs.docker-disable-retagging }}"
elif [[ $GITHUB_REF == refs/heads/master ]]; then
TAG="master-${GITHUB_SHA::8}"
LATEST="master"
PUSH="true"
Expand Down

0 comments on commit 05a3c2b

Please sign in to comment.