Automatic syncronization from Notion to Github
<aside> ⚠️ NOTE: Notion2Github is dependent on notion-py, the unofficial Notion API created by Jamie Alexandre. This may not be stable because it is not an official API. If you need to use in production, I recommend waiting for their official release.
</aside>
Go to github.com/{your_id}/{your_repo}/settings/secrets/actions
Set token_v2
of Notion to your repository secret.
Create a workflow in .github/workflows/**.yml
of your repository
Here are examples.
name: Notion2Github
on:
pull_request:
push:
branches:
- main
jobs:
auto-sync-from-notion-to-github:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Notion2Github
uses: younho9/[email protected]
with:
database-url: '<https://www.notion.so/acc3dfd0339e4cacb5baae8673fddfad>'
docs-directory: docs
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
- name: Format documents
uses: creyD/[email protected]
with:
prettier_options: --write ./docs/**/*.md
commit_message: 'docs: Update docs (auto)'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Notion2Github
on:
schedule:
- cron: '0 14 * * *'
jobs:
auto-sync-from-notion-to-github:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Notion2Github
uses: younho9/[email protected]
with:
database-url: '<https://www.notion.so/acc3dfd0339e4cacb5baae8673fddfad>'
docs-directory: docs
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
- name: Format documents
uses: creyD/[email protected]
with:
prettier_options: --write ./docs/**/*.md
commit_message: 'docs: Update docs (auto)'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}