Sync Notion to GitHub Blog #2364
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync Notion to GitHub Blog | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 * * * *" | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: | | |
| pip install notion-client==2.2.1 | |
| pip install markdownify | |
| - name: Run export script | |
| env: | |
| NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | |
| NOTION_DATABASE_ID: ${{ secrets.NOTION_DATABASE_ID }} | |
| run: python notion_export.py | |
| - name: Commit and Push | |
| run: | | |
| git config --global user.email "action@github.com" | |
| git config --global user.name "GitHub Action" | |
| git add . | |
| git commit -m "Notion → GitHub Sync" || echo "No changes" | |
| git push | |