docs: added fetching from notion (#2670)
* Added new Docusaurus instance that fetches automatically from Notion * Add Github workflow to fetch docs from Notion * Added legacy peer deps to solve dependency problems * Fix git ignore and added pages
This commit is contained in:
parent
bab941f3e6
commit
3aa2513a86
354 changed files with 20640 additions and 23291 deletions
77
.github/workflows/fetch_docs_notion.yml
vendored
Normal file
77
.github/workflows/fetch_docs_notion.yml
vendored
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
name: Fetch Docs from Notion
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
NODE_VERSION: "21"
|
||||
|
||||
jobs:
|
||||
fetch-docs:
|
||||
name: Fetch Docs from Notion
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
id: setup-node
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config --global user.name 'github-actions[bot]'
|
||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
|
||||
- name: Create new branch
|
||||
run: |
|
||||
git checkout -b update-docs-$(date +%Y%m%d%H%M%S)
|
||||
|
||||
- name: Cache Node.js dependencies
|
||||
uses: actions/cache@v4
|
||||
id: npm-cache
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('docs/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Install Node.js dependencies
|
||||
run: |
|
||||
cd docs
|
||||
npm install --legacy-peer-deps
|
||||
if: ${{ steps.setup-node.outputs.cache-hit != 'true' }}
|
||||
|
||||
- name: Fetch Docs from Notion
|
||||
run: |
|
||||
cd docs
|
||||
npm run pull
|
||||
env:
|
||||
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
|
||||
NOTION_DOCS_ROOT_PAGE_ID: ${{ secrets.NOTION_DOCS_ROOT_PAGE_ID }}
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git add .
|
||||
git commit -m "Update docs from Notion"
|
||||
|
||||
- name: Push changes
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
|
||||
|
||||
- name: Create Pull Request
|
||||
id: create_pr
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: Update docs from Notion
|
||||
branch: update-docs-$(date +%Y%m%d%H%M%S)
|
||||
base: main
|
||||
title: "docs: update docs from notion"
|
||||
body: This PR updates the documentation from Notion.
|
||||
labels: documentation
|
||||
Loading…
Add table
Add a link
Reference in a new issue