From ee606139a80121fd6ee1b8233f82af994c4e1178 Mon Sep 17 00:00:00 2001 From: MAZE Date: Thu, 4 Jan 2024 20:18:45 +0330 Subject: [PATCH] chore: update GitHub action --- .github/workflows/build_docker.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index dec186c..cf7d1ac 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -2,8 +2,8 @@ name: Build and push main image on: push: - branches: - - main + tags: + - '*' jobs: push-store-image: @@ -22,5 +22,13 @@ jobs: - name: 'Build Inventory Image' run: | - docker build . --tag ghcr.io/remvze/moodist:latest - docker push ghcr.io/remvze/moodist:latest + IMAGE_NAME="ghcr.io/remvze/moodist" + + GIT_TAG=${{ github.ref }} + GIT_TAG=${GIT_TAG#refs/tags/} + + docker build . --tag $IMAGE_NAME:latest + docker push $IMAGE_NAME:latest + + docker build . --tag $IMAGE_NAME:$GIT_TAG + docker push $IMAGE_NAME:$GIT_TAG