mirror of
https://github.com/tomasriveral/ReSSPublica.git
synced 2026-08-12 02:38:37 +02:00
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
name: Build RSS feeds
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 6 * * *" # Runs once per day at 06:00 UTC
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.14"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install sparqlwrapper feedgen lxml tinydb
|
|
|
|
- name: Set environment variables
|
|
run: |
|
|
echo "RESSPUBLICA_CACHE=$GITHUB_WORKSPACE/.cache" >> $GITHUB_ENV
|
|
mkdir -p "$GITHUB_WORKSPACE/.cache"
|
|
|
|
- name: Generate feeds
|
|
run: |
|
|
python resspublica/main.py
|
|
|
|
- name: Commit and push changes
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
git add feed/ .cache/
|
|
|
|
if git diff --cached --quiet; then
|
|
echo "No changes to commit"
|
|
exit 0
|
|
fi
|
|
|
|
git commit -m "feeds: update $(date -u +%Y-%m-%d)"
|
|
git push origin main
|