From d041dca6ec90017c84a01b3b91f8d61913eafef2 Mon Sep 17 00:00:00 2001 From: sergeynikolaev Date: Thu, 7 Sep 2023 14:35:00 +0300 Subject: [PATCH] release on tag, not on merge --- .github/workflows/build.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ecf9c72..48f8c19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ name: Test and Publish Containers on: push: branches: ['main'] + tags: ['*.*.*'] pull_request: branches: ['main'] @@ -31,7 +32,7 @@ jobs: path: dist push_container: - if: github.ref == 'refs/heads/main' + if: github.ref_type == 'tag' runs-on: ubuntu-latest needs: [build] steps: @@ -50,16 +51,12 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: get-npm-version - id: package-version - uses: martinbeentjes/npm-get-version-action@v1.3.1 - - name: Backend Build and push uses: docker/build-push-action@v2 with: file: ./apps/backend/Dockerfile push: true - tags: waveditor/backend:${{ steps.package-version.outputs.current-version }} + tags: waveditor/backend:${{ github.ref_name }} context: . - name: Frontend Build and push @@ -67,11 +64,11 @@ jobs: with: file: ./apps/wavemail/Dockerfile push: true - tags: waveditor/frontend:${{ steps.package-version.outputs.current-version }} + tags: waveditor/frontend:${{ github.ref_name }} context: . deploy: - if: github.ref == 'refs/heads/main' + if: github.ref_type == 'tag' runs-on: ubuntu-latest needs: [push_container] steps: