weread note sync #2
This file contains 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: weread note sync | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
sync: | |
name: Sync | |
runs-on: ubuntu-latest | |
env: | |
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | |
BOOK_DATABASE_ID: ${{ secrets.BOOK_DATABASE_ID }} | |
AUTHOR_DATABASE_ID: ${{ secrets.AUTHOR_DATABASE_ID }} | |
CATEGORY_DATABASE_ID: ${{ secrets.CATEGORY_DATABASE_ID }} | |
BOOKMARK_DATABASE_ID: ${{ secrets.BOOKMARK_DATABASE_ID }} | |
REVIEW_DATABASE_ID: ${{ secrets.REVIEW_DATABASE_ID }} | |
CHAPTER_DATABASE_ID: ${{ secrets.CHAPTER_DATABASE_ID }} | |
YEAR_DATABASE_ID: ${{ secrets.YEAR_DATABASE_ID }} | |
WEEK_DATABASE_ID: ${{ secrets.WEEK_DATABASE_ID }} | |
MONTH_DATABASE_ID: ${{ secrets.MONTH_DATABASE_ID }} | |
DAY_DATABASE_ID: ${{ secrets.DAY_DATABASE_ID }} | |
WEREAD_COOKIE: ${{ secrets.WEREAD_COOKIE }} | |
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 "${{ github.ref }}" "${{ github.repository }}" | |
- name: weread heatmap | |
run: | | |
github_heatmap weread --weread_cookie "${{secrets.WEREAD_COOKIE}}" --year 2018-2023 --me "${{secrets.NAME}}" --with-animation --background-color=#ffffff --track-color=#ACE7AE --special-color1=#69C16E --special-color2=#549F57 --dom-color=#EBEDF0 --text-color=#000000 | |
- 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" |