Untitled

将页面从概念同步到 GitHub 以用作静态网站

访问:notion-jam · Actions · GitHub Marketplace

Usage

Quick Start

  1. Create a new Notion Integration

    https://user-images.githubusercontent.com/3372598/168543273-8b592c0d-8459-4669-a608-4473edcd4a40.gif

  2. Add Notion secret to GitHub repository

    1. Go to github.com/{user}/{repo}/settings/secrets/actions

    2. Set NOTION_SECRET of Notion to your repository secret.

      https://user-images.githubusercontent.com/3372598/168543331-efb3a64a-d126-477d-84db-d05b22131ce4.gif

  3. Share the Database with the integration

    https://user-images.githubusercontent.com/3372598/168543407-b8d7373a-c6ea-4e2a-9eef-2a29f6a557bb.gif

  4. Create a workflow in .github/workflows/**.yml of your repository

    Example Workflow

    `# This is a basic workflow to help you get started with Actions

    name: NotionJAM

    Controls when the workflow will run

    on: schedule: - cron: "0 21 * * *" # daily push: branches: [master, main]

    Allows you to run this workflow manually from the Actions tab

    workflow_dispatch:

    A workflow run is made up of one or more jobs that can run sequentially or in parallel

    jobs:

    This workflow contains a single job called "build"

    build: # The type of runner that the job will run on runs-on: ubuntu-latest

     # Steps represent a sequence of tasks that will be executed as part of the job
     steps:
       # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
       - uses: actions/checkout@v3
    
       - name: notion-jam
         uses: victornpb/[email protected]
         with:
           NOTION_SECRET: ${{ secrets.NOTION_SECRET }}
           NOTION_DATABASE: <https://www.notion.so/9e34cee9f5bd4c4aaf0d2eaf73ead47b>
           FILTER_PROP: Status
           FILTER_VALUES: Published
           CONVERT_PROP_CASE: snake
           ARTICLE_PATH: content/posts/{title}/README.md
           ASSETS_PATH: ./
           PARALLEL_PAGES: 25
           PARALLEL_DOWNLOADS_PER_PAGE: 3
           DOWNLOAD_IMAGE_TIMEOUT: 30
           SKIP_DOWNLOADED_IMAGES: true
           DOWNLOAD_FRONTMATTER_IMAGES: true
       
       - name: Save changes
         uses: stefanzweifel/git-auto-commit-action@v4
         with:
           commit_message: Commit changes`