Files
u-claw/.github/workflows/daily-content.yml
2026-04-02 20:34:15 +08:00

39 lines
1.0 KiB
YAML

name: Daily Content Generator
on:
schedule:
- cron: '0 0 * * *' # UTC 00:00 = 北京时间 08:00
workflow_dispatch: # 支持手动触发测试
jobs:
generate:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Generate daily content
env:
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
run: node .github/scripts/generate-daily.js
- name: Commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add website/daily/data.json
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: update daily content $(date -u '+%Y-%m-%d')"
git push
fi