Skip to content

Commit 46aeea4

Browse files
mergify[bot]tthvo
andauthored
feat(ci): allow preview deployment on release branches (#1047) (#1102)
(cherry picked from commit 7e2966a) Co-authored-by: Thuan Vo <[email protected]>
1 parent 92d583c commit 46aeea4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/ci-preview.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
push:
1010
branches:
1111
- main
12+
- v[0-9]+
13+
- v[0-9]+.[0-9]+
14+
- cryostat-v[0-9]+.[0-9]+
1215
paths:
1316
- 'src/**'
1417
- '!src/test/**'
@@ -19,8 +22,6 @@ on:
1922
jobs:
2023
build-preview:
2124
if: ${{ github.repository_owner == 'cryostatio' }}
22-
env:
23-
DEPLOY_DOMAIN: ${{ github.repository_owner }}-${{ github.event.repository.name }}-main.surge.sh
2425
runs-on: ubuntu-latest
2526
steps:
2627
- uses: actions/checkout@v2
@@ -33,4 +34,6 @@ jobs:
3334
run: yarn build:preview:notests
3435
- name: Publish to surge
3536
run: |
37+
FORMATTED_REF="$(echo ${{ github.ref_name }} | sed 's/\.//')"
38+
DEPLOY_DOMAIN="${{ github.repository_owner }}-${{ github.event.repository.name }}-$FORMATTED_REF.surge.sh"
3639
npx surge --project ./dist --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }}

0 commit comments

Comments
 (0)