Skip to content

Fetch docs and deploy preview branch #17

Fetch docs and deploy preview branch

Fetch docs and deploy preview branch #17

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 }}