Daily Paper Analysis #159
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: Daily Paper Analysis | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # 每天 UTC 时间 00:00 运行 | |
| workflow_dispatch: # 允许手动触发 | |
| jobs: | |
| analyze-papers: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 # 设置超时时间为5分钟 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' # 启用pip缓存 | |
| - name: Cache papers directory | |
| uses: actions/cache@v3 | |
| with: | |
| path: papers | |
| key: ${{ runner.os }}-papers-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-papers- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run paper analysis | |
| env: | |
| DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} | |
| SMTP_SERVER: ${{ secrets.SMTP_SERVER }} | |
| SMTP_PORT: ${{ secrets.SMTP_PORT }} | |
| SMTP_USERNAME: ${{ secrets.SMTP_USERNAME }} | |
| SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }} | |
| EMAIL_FROM: ${{ secrets.EMAIL_FROM }} | |
| EMAIL_TO: ${{ secrets.EMAIL_TO }} | |
| run: | | |
| cd src | |
| python main.py | |
| - name: Commit and push changes | |
| run: | | |
| git config --global user.name 'curryfromuestc' | |
| git config --global user.email 'curryfromuestc@gmail.com' | |
| git add . | |
| git commit -m "Update paper analysis for $(date +'%Y-%m-%d')" || echo "No changes to commit" | |
| git push |