File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
.github/actions/gcp-docker-build-push Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,13 @@ inputs:
1919 image-name :
2020 required : true
2121 description : " Docker image name"
22+ image-tag :
23+ required : false
24+ description : " Docker image tag"
25+ dockerfile :
26+ required : false
27+ description : " Dockerfile path"
28+ default : ${{ github.workspace }}/Dockerfile
2229runs :
2330 using : " composite"
2431 steps :
4249 GCP_PROJECT_ID : ${{ inputs.gcp-project-id }}
4350 GCP_ARTIFACT_REPO : ${{ inputs.gcp-artifact-repo }}
4451 IMAGE_NAME : ${{ inputs.image-name }}
52+ IMAGE_TAG : ${{ inputs.image-tag }}
4553 run : |
4654 IMAGE="$GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/$GCP_ARTIFACT_REPO/$IMAGE_NAME"
47- if [[ "${GITHUB_REF_TYPE}" == "tag" && "${GITHUB_REF_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
55+ if [ ! -z "$IMAGE_TAG" ]; then
56+ TAGS="$IMAGE:$IMAGE_TAG"
57+ elif [[ "${GITHUB_REF_TYPE}" == "tag" && "${GITHUB_REF_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
4858 TAGS="$IMAGE:${GITHUB_REF_NAME}"
4959 elif [[ "${GITHUB_REF_NAME}" == "main" ]]; then
5060 TAGS="$IMAGE:latest"
7282 uses : docker/build-push-action@v6
7383 with :
7484 push : true
85+ file : ${{ inputs.dockerfile }}
7586 tags : ${{ steps.vars.outputs.tags }}
7687 secret-files : |
7788 netrc=/home/runner/.netrc
You can’t perform that action at this time.
0 commit comments