From ac697de246f70c514e36492a70cd3b5c9eed38ba Mon Sep 17 00:00:00 2001 From: Yurii Puchkov Date: Sat, 23 Dec 2023 20:46:46 -0700 Subject: [PATCH] feat(cicd): set docker tag if the current latest git commit is tagged. --- .github/workflows/build.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6182ad6..6d10888 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -62,5 +62,9 @@ jobs: shell: bash run: | set -x - IMAGE_NAME_WITH_VERSION="${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest" + DOCKER_TAG="$(git tag --contains)" + if [[ "${DOCKER_TAG}" == "" ]]; then + DOCKER_TAG="latest" + fi + IMAGE_NAME_WITH_VERSION="${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${DOCKER_TAG}" docker push "${IMAGE_NAME_WITH_VERSION}"