Skip to content

Sync notion marker

Sync notion marker #84

name: Sync notion marker
on:
schedule:
- cron: '0 0 * * *'
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Convert Notion to Blog
env:
NOTION_API_TOKEN: ${{ secrets.NOTION_API_KEY }}
NOTION_BLOG_PAGE: ${{ secrets.NOTION_PAGE_ID }}
run: pnpm run sync-notion-marker
- name: Commit and push changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "feat: sync markers from notion" || echo "nothing to commit"
git push || echo "nothing to push"