-
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.33 KB
/
fetch-and-deploy-preview.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Fetch docs and deploy preview branch
on: workflow_dispatch
jobs:
deploy-preview:
name: Fetch docs and deploy preview branch
runs-on: ubuntu-latest
environment: deploy
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22
- 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 changes
run: |
git config user.name "github"
git config user.email ""
git add .
git commit -m "Update files from Notion"
- name: Build the site
run: ./build.sh
- name: Push changes to preview branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push --force origin HEAD:preview
- name: Deploy preview to Netlify
run: ./deploy.sh --github-action-preview-subdomain
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}