File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
name : Preview Deployment
2
2
3
3
on :
4
+ push :
5
+ branches :
6
+ - main
4
7
pull_request :
5
8
types : [opened, synchronize, labeled]
6
9
@@ -10,14 +13,15 @@ concurrency:
10
13
11
14
jobs :
12
15
run :
13
- if : contains(github.event.pull_request.labels.*.name, 'preview')
16
+ if : contains(github.event.pull_request.labels.*.name, 'preview') || ${{ github.ref_name == 'main' }}
14
17
runs-on : ubuntu-latest
15
18
concurrency :
16
19
group : netlify
17
20
cancel-in-progress : false
18
21
env :
19
22
REPO_ACCESS_TOKEN : ${{ secrets.REPO_ACCESS_TOKEN }}
20
23
APP_ENV : prod
24
+ BRANCH_NAME : ${{ github.ref_name }}
21
25
22
26
steps :
23
27
@@ -86,11 +90,14 @@ jobs:
86
90
- name : Deploy to Netlify
87
91
id : netlify_deploy
88
92
run : |
93
+ prod_flag=""
94
+ if [ "$BRANCH_NAME" = "main" ]; then prod_flag="--prod"; fi
89
95
netlify deploy \
90
96
--dir public \
91
97
--site ${{ secrets.NETLIFY_SITE_ID }} \
92
98
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
93
99
--json \
100
+ $prod_flag \
94
101
> deploy_output.json
95
102
96
103
- name : Generate URL Preview
You can’t perform that action at this time.
0 commit comments