From 8be51747d105f006a9c8955080a1316d458722c2 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..bf5052d 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}"