Skip to content

Commit

Permalink
release on tag, not on merge
Browse files Browse the repository at this point in the history
  • Loading branch information
qvantor committed Sep 7, 2023
1 parent 7fd27a8 commit d041dca
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Test and Publish Containers
on:
push:
branches: ['main']
tags: ['*.*.*']
pull_request:
branches: ['main']

Expand Down Expand Up @@ -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:
Expand All @@ -50,28 +51,24 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]

- 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
uses: docker/build-push-action@v2
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:
Expand Down

0 comments on commit d041dca

Please sign in to comment.