File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -87,20 +87,31 @@ jobs:
8787 - name : Install Netlify
8888 run :
npm install [email protected] -g 8989
90- - name : Deploy to Netlify
90+ - name : Deploy to Netlify Preview
91+ if : github.event_name == 'pull_request'
9192 id : netlify_deploy
9293 run : |
93- prod_flag=""
94- if [ "$BRANCH_NAME" = "main" ]; then prod_flag="--prod"; fi
9594 netlify deploy \
9695 --dir public \
9796 --site ${{ secrets.NETLIFY_SITE_ID }} \
9897 --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 }} \
100110 --json \
101111 > deploy_output.json
102112
103113 - name : Generate URL Preview
114+ if : github.event_name == 'pull_request'
104115 id : url_preview
105116 run : |
106117 NETLIFY_PREVIEW_URL=$(jq -r '.deploy_url' deploy_output.json)
You can’t perform that action at this time.
0 commit comments