Skip to content

Douban to NeoDB Sync #135

Douban to NeoDB Sync

Douban to NeoDB Sync #135

name: Douban to NeoDB Sync
on:
schedule:
- cron: '30 * * * *' # Run hourly (offset by 30 mins from Simkl sync)
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run sync script
env:
NEODB_ACCESS_TOKEN: ${{ secrets.NEODB_ACCESS_TOKEN }}
NEODB_INSTANCE_DOMAIN: ${{ secrets.NEODB_INSTANCE_DOMAIN }}
run: python sync_neodb.py
- 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 sync_history_neodb.json || true
# Only commit if there are changes
git diff --quiet && git diff --staged --quiet || (git commit -m "Auto-update NeoDB sync history" && git push)