-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.49 KB
/
Copy pathbot.yml
File metadata and controls
46 lines (40 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: News Bot
on:
push:
branches: [main]
schedule:
- cron: '0 */3 * * *'
workflow_dispatch:
# Nunca dos runs a la vez: si push y schedule coinciden, ambos leerían el mismo
# sha de noticias.json y el segundo commit fallaría con 409 (noticias ya enviadas
# a Telegram pero no guardadas → se re-enviarían como duplicados en el run siguiente).
concurrency:
group: news-bot
cancel-in-progress: false
jobs:
run-bot:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
run: python -m unittest test_run_job -v
- name: Run bot
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
UNSPLASH_ACCESS_KEY: ${{ secrets.UNSPLASH_ACCESS_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
GROQ_API_KEY_2: ${{ secrets.GROQ_API_KEY_2 }}
GROQ_API_KEY_3: ${{ secrets.GROQ_API_KEY_3 }}
NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
GREYNOISE_API_KEY: ${{ secrets.GREYNOISE_API_KEY }}
run: python run_job.py