Skip to content

Commit

Permalink
ci: update Deploy workflow to tag-based
Browse files Browse the repository at this point in the history
  • Loading branch information
lalver1 committed Jul 11, 2024
1 parent 650537a commit a3a5341
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,25 @@ on:
push:
branches:
- main
- test
- prod
tags:
# pre-release tag
- "202[3-9].[0-9][0-9].[0-9]+-rc[0-9]+"
# release tags
- "202[3-9].[0-9][0-9].[0-9]+"

defaults:
run:
shell: bash

concurrency:
# this expression gives us the name of the deployment environment. It works like a ternary operation (see https://github.com/actions/runner/issues/409#issuecomment-727565588)
group: ${{ github.ref_type != 'tag' && github.ref_name || contains(github.ref, '-rc') && 'test' || 'prod' }}
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ github.ref_name }}
concurrency: ${{ github.ref_name }}
environment: ${{ github.ref_type != 'tag' && github.ref_name || contains(github.ref, '-rc') && 'test' || 'prod' }}

steps:
- name: Checkout
Expand Down

0 comments on commit a3a5341

Please sign in to comment.