Deployment & Scheduling Guide
Options provided in this repository:
- GitHub Actions (recommended for reliability)
- A workflow
.github/workflows/daily-news.ymlrunsscripts/send-todays-news.ps1onwindows-latest. - It's configured to run daily at 09:00 IST (see cron in the workflow).
- You can also trigger it manually from the Actions UI or via
workflow_dispatchinputs. Quick setup: - The workflow now runs a self-contained Docker Compose job by default (mode=
compose) for scheduled runs. - Required repository secrets for the default compose run:
TELEGRAM_BOT_TOKEN— Telegram bot token used by thenotificationservice.LLM_API_KEY— optional, used byai-refinerif configured.
Set the secrets with the GitHub CLI:
gh secret set TELEGRAM_BOT_TOKEN --body '<your-telegram-bot-token>'
gh secret set LLM_API_KEY --body '<your-llm-api-key>'Manual runs:
- Default (compose) manual run — runs the self-contained compose job (recommended):
gh workflow run daily-news.yml --ref main- Direct/manual run (target an external ai-refiner URL):
gh workflow run daily-news.yml --ref main --field mode=direct --field aiRefinerUrl='https://your-host:8082/api/refine/test' --field limit=10 --field sinceDays=0- VPS deployment with Docker Compose + systemd timer (runs script on host daily at 09:00 IST)
-
infrastructure/docker-compose.news.ymlcontains example service definitions forai-refiner,news-fetcher,notification, and a manualnews-posterrunner. -
To run services:
docker compose -f infrastructure/docker-compose.news.yml up -d --build
-
To schedule the
send-todays-news.ps1script on a Linux VPS (uses Docker to execute the script):- Copy the repo to
/opt/news-platform. - Create
/etc/default/news-posterwithAI_REFINER_URL,LIMIT,SINCE_DAYS. - Copy
infrastructure/systemd/news-poster.serviceandinfrastructure/systemd/news-poster.timerto/etc/systemd/system/. - Run:
sudo systemctl daemon-reload && sudo systemctl enable --now news-poster.timer.
- Copy the repo to
-
Check logs with
journalctl -u news-poster.service.
Notes & security:
- Keep secrets out of source control — use GitHub Secrets for Actions and environment files with restrictive permissions on VPS.
- If you host the services in Docker Compose on the same host,
AI_REFINER_URLshould point tohttp://ai-refiner:8082/api/refine/testwhen the script runs inside a container network, orhttp://localhost:8082/api/refine/testwhen the timer runsdocker runmounting the repo.