From 2796aa44fd276eba3f8753faa50b6c55109553ac Mon Sep 17 00:00:00 2001 From: "Eric O. Korman" Date: Wed, 27 Sep 2023 15:58:30 -0500 Subject: [PATCH] tag api image with version tag (#182) --- .github/workflows/docker.yml | 9 +++++++++ .github/workflows/tests-and-coverage.yml | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 52b0ec7b9..dae9d29ae 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,6 +6,8 @@ on: - api/** - .github/workflows/docker.yml branches: [main] + tags: + - "v*" jobs: build-and-publish-docker: @@ -28,3 +30,10 @@ jobs: IMAGE_NAME_WITH_COMMIT_HASH=$IMAGE_NAME:${{ github.sha }} docker tag $IMAGE_NAME $IMAGE_NAME_WITH_COMMIT_HASH docker push $IMAGE_NAME_WITH_COMMIT_HASH + # if there's a git tag then add another tag to the image with the git tag and push it + - name: push git tag + if: startsWith(github.ref, 'refs/tags/') + run: | + TAG=$(git describe --tags --abbrev=0) + docker tag $IMAGE_NAME $IMAGE_NAME:$TAG + docker push $IMAGE_NAME:$TAG diff --git a/.github/workflows/tests-and-coverage.yml b/.github/workflows/tests-and-coverage.yml index 67b842a3c..46dab443e 100644 --- a/.github/workflows/tests-and-coverage.yml +++ b/.github/workflows/tests-and-coverage.yml @@ -2,6 +2,12 @@ name: Unit, functional, integration tests and code coverage on: push: + paths: + - "api/**" + - "client/**" + - "tests/**" + - "docs/**" + branches: "**" jobs: backend-functional-tests: