-
-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! Adding preview also for main branch
- Loading branch information
Showing
1 changed file
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,20 +87,31 @@ jobs: | |
- name: Install Netlify | ||
run: npm install [email protected] -g | ||
|
||
- name: Deploy to Netlify | ||
- name: Deploy to Netlify Preview | ||
if: github.event_name == 'pull_request' | ||
id: netlify_deploy | ||
run: | | ||
prod_flag="" | ||
if [ "$BRANCH_NAME" = "main" ]; then prod_flag="--prod"; fi | ||
netlify deploy \ | ||
--dir public \ | ||
--site ${{ secrets.NETLIFY_SITE_ID }} \ | ||
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \ | ||
$prod_flag \ | ||
--json \ | ||
> deploy_output.json | ||
- name: Deploy to Netlify Prod | ||
if: github.event_name != 'pull_request' | ||
id: netlify_deploy | ||
run: | | ||
netlify deploy \ | ||
--prod \ | ||
--dir public \ | ||
--site ${{ secrets.NETLIFY_SITE_ID }} \ | ||
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \ | ||
--json \ | ||
> deploy_output.json | ||
- name: Generate URL Preview | ||
if: github.event_name == 'pull_request' | ||
id: url_preview | ||
run: | | ||
NETLIFY_PREVIEW_URL=$(jq -r '.deploy_url' deploy_output.json) | ||
|