注意:配置项会过期,如果任务失败请及时更新
这个文件表示每天早上0点将notion文件备份一次
name: "Notion backup"
on:
push:
branches:
- master
schedule:
# 表示每天早上0点执行一次
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
backup:
runs-on: ubuntu-latest
name: Backup
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: '18'
- name: Delete previous backup
run: rm -rf markdown html *.zip
- name: Setup dependencies
run: npm install -g notion-backup
- name: Run backup
run: notion-backup
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
NOTION_FILE_TOKEN: ${{ secrets.NOTION_FILE_TOKEN }}
NOTION_SPACE_ID: ${{ secrets.NOTION_SPACE_ID }}
NODE_OPTIONS: "--max-http-header-size 15000"
- name: Delete zips
run: |
rm -f *.zip
rm -f markdown/*-Part*.zip
rm -f html/*-Part*.zip
- name: Commit changes
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Automated snapshot"
git push