Skip to content

Fetch docs and deploy preview branch #15

Fetch docs and deploy preview branch

Fetch docs and deploy preview branch #15

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@v4
- name: Set up Node.js
uses: actions/setup-node@v3
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 }}