diff --git a/.github/workflows/02-build-docker-image.yml b/.github/workflows/02-build-docker-image.yml index 00e46b05a2e2c0d6eac4473000e77ec64dbaa32e..17449046f6c75d181867433e584589679e121ec3 100644 --- a/.github/workflows/02-build-docker-image.yml +++ b/.github/workflows/02-build-docker-image.yml @@ -1,14 +1,28 @@ -name: Build docker image with tag latest +name: Build docker image with appropriate tag on: push: branches: - develop + release: + types: [released] jobs: build_docker_image: runs-on: ubuntu-22.04 steps: + - name: Determine Docker Tag + id: docker_tag + run: | + GIT_EVENT=${{ github.event_name }} + GIT_BRANCH_NAME=${GITHUB_REF##*/} + if [[ $GIT_EVENT == 'push' && $GIT_BRANCH_NAME == 'develop' ]]; then + echo "DOCKER_TAG=latest" >> $GITHUB_ENV + elif [[ $GIT_EVENT == 'release' ]]; then + GIT_TAG_NAME=${{ github.event.release.tag_name }} + echo "DOCKER_TAG=$(echo $GIT_TAG_NAME | cut -c 2-)" >> $GITHUB_ENV + fi + - name: Checkout code uses: actions/checkout@v4 @@ -26,6 +40,7 @@ jobs: - name: Build image and push to Artifactory uses: docker/build-push-action@v3 with: + context: . push: true tags: | - ${{ secrets.DOCKER_REPOSITORY_LOCAL }}:latest \ No newline at end of file + ${{ secrets.DOCKER_REPOSITORY_LOCAL }}:${{ env.DOCKER_TAG }} \ No newline at end of file diff --git a/build.gradle b/build.gradle index cfdad9f0bc1bed1bd14dfb8996e60fa339709aef..c4cb935bab72760be5baa23e28f356cc3ffab678 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id "org.sonarqube" version "3.2.0" } -version = '1.6.0-SNAPSHOT' +version = '1.6.0' task buildGUI(type: Exec) { println 'Building using Angular CLI'