Sync Notion Docs #11
Workflow file for this run
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 Docs | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| pull-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun i | |
| - name: Notion To Markdown | |
| run: bun notionToMd | |
| env: | |
| NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }} | |
| DATABASE_ID: ${{ secrets.DATABASE_ID }} | |
| - name: Commit generated docs | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| # Stage specific paths (adjust to your generated files) | |
| git add docs i18n | |
| # Commit if there are changes | |
| git diff --cached --quiet || git commit -m "chore: update docs from Notion" | |
| # Push back to the repository | |
| git push | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |