diff --git a/README.md b/README.md index 32cd9b6..b8653ba 100644 --- a/README.md +++ b/README.md @@ -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` | diff --git a/action.yml b/action.yml index de74c73..1f1e5ae 100644 --- a/action.yml +++ b/action.yml @@ -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 @@ -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"