-
Notifications
You must be signed in to change notification settings - Fork 4.9k
48 lines (46 loc) · 1.61 KB
/
weread.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: weread note sync
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
sync:
name: Sync
runs-on: ubuntu-latest
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
NOTION_PAGE_ID: ${{ secrets.NOTION_PAGE_ID }}
WEREAD_COOKIE: ${{ secrets.WEREAD_COOKIE }}
BOOK_DATABASE_NAME: ${{ vars.BOOK_DATABASE_NAME }}
AUTHOR_DATABASE_NAME: ${{ vars.AUTHOR_DATABASE_NAME }}
CATEGORY_DATABASE_NAME: ${{ vars.CATEGORY_DATABASE_NAME }}
BOOKMARK_DATABASE_NAME: ${{ vars.BOOKMARK_DATABASE_NAME }}
REVIEW_DATABASE_NAME: ${{ vars.REVIEW_DATABASE_NAME }}
CHAPTER_DATABASE_NAME: ${{ vars.CHAPTER_DATABASE_NAME }}
YEAR_DATABASE_NAME: ${{ vars.YEAR_DATABASE_NAME }}
WEEK_DATABASE_NAME: ${{ vars.WEEK_DATABASE_NAME }}
MONTH_DATABASE_NAME: ${{ vars.MONTH_DATABASE_NAME }}
DAY_DATABASE_NAME: ${{ vars.DAY_DATABASE_NAME }}
REF: ${{ github.ref }}
REPOSITORY: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: weread sync
run: |
python -u scripts/weread.py
- name: push
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m 'add new cover' || echo "nothing to commit"
git push || echo "nothing to push"