Fetch Daily Categories #120
This file contains hidden or 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: Fetch Daily Categories | |
| on: | |
| schedule: # UTC 03:00 ≈ 北京时间上午 11:00 | |
| - cron: "0 3 * * *" | |
| workflow_dispatch: # 允许手动触发 | |
| jobs: | |
| fetch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| - name: Install project | |
| run: | | |
| pip install --upgrade pip | |
| pip install . | |
| - name: Generate today’s category CSV | |
| run: python scripts/fetch_daily_categories.py | |
| # 把结果保存为构建产物,避免反复提交代码 | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: categories-${{ github.run_number }} | |
| path: data/categories/ |