File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -87,20 +87,31 @@ jobs:
87
87
- name : Install Netlify
88
88
run :
npm install [email protected] -g
89
89
90
- - name : Deploy to Netlify
90
+ - name : Deploy to Netlify Preview
91
+ if : github.event_name == 'pull_request'
91
92
id : netlify_deploy
92
93
run : |
93
- prod_flag=""
94
- if [ "$BRANCH_NAME" = "main" ]; then prod_flag="--prod"; fi
95
94
netlify deploy \
96
95
--dir public \
97
96
--site ${{ secrets.NETLIFY_SITE_ID }} \
98
97
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
99
- $prod_flag \
98
+ --json \
99
+ > deploy_output.json
100
+
101
+ - name : Deploy to Netlify Prod
102
+ if : github.event_name != 'pull_request'
103
+ id : netlify_deploy
104
+ run : |
105
+ netlify deploy \
106
+ --prod \
107
+ --dir public \
108
+ --site ${{ secrets.NETLIFY_SITE_ID }} \
109
+ --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
100
110
--json \
101
111
> deploy_output.json
102
112
103
113
- name : Generate URL Preview
114
+ if : github.event_name == 'pull_request'
104
115
id : url_preview
105
116
run : |
106
117
NETLIFY_PREVIEW_URL=$(jq -r '.deploy_url' deploy_output.json)
You can’t perform that action at this time.
0 commit comments