News #61
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: News | |
on: | |
schedule: | |
# Runs every day at 9 AM Beijing time (1 AM UTC). | |
- cron: '0 1 * * *' | |
workflow_dispatch: # Allows manual triggering | |
push: | |
# Only trigger if BOTH files change in the same commit/push | |
# This requires a filter job below to check for both files | |
paths: | |
- scripts/nytimes/news_bot.py | |
- .github/workflows/news.yml | |
concurrency: | |
group: 'news' | |
cancel-in-progress: false | |
jobs: | |
send-news: | |
runs-on: ubuntu-latest | |
environment: github-pages | |
env: | |
TELEGRAM_BOT_API_KEY: ${{ secrets.TELEGRAM_BOT_API_KEY }} | |
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 5 | |
- name: Set up Python 3.13.2 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.13.2" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.simple.txt | |
- name: Run news bot script | |
run: python scripts/nytimes/news_bot.py |