-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow files for managing previews and deploys
- Loading branch information
Showing
6 changed files
with
78 additions
and
11 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Approve preview | ||
on: workflow_dispatch | ||
|
||
jobs: | ||
deploy-preview: | ||
name: Push preview to master | ||
runs-on: ubuntu-latest | ||
environment: deploy | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: preview | ||
|
||
- name: Push to master | ||
run: git push origin preview:master |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Deploy to live | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
deploy-live: | ||
name: Deploy to live | ||
runs-on: ubuntu-latest | ||
environment: deploy | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build the site | ||
run: ./build.sh | ||
|
||
- name: Deploy to Netlify | ||
run: ./deploy.sh --live | ||
env: | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} |
15 changes: 6 additions & 9 deletions
15
.github/workflows/update-and-preview.yml → .github/workflows/deploy-preview-branch.yml
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Update preview branch | ||
on: workflow_dispatch | ||
|
||
jobs: | ||
deploy-preview: | ||
name: Update preview branch | ||
runs-on: ubuntu-latest | ||
environment: deploy | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Pull documents from Notion | ||
run: ./pull_docs.sh --skip-pulling-from-s3 | ||
env: | ||
SF_HELP_NOTION_TOKEN: ${{ secrets.SF_HELP_NOTION_TOKEN }} | ||
SF_HELP_NOTION_ROOT_PAGE_ID: ${{ secrets.SF_HELP_NOTION_ROOT_PAGE_ID }} | ||
|
||
- name: Commit and push changes to preview branch | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
git commit -m "Update files from Notion" | ||
git push -f origin HEAD:preview |
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
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