From cbc2a33bec4cda189e6bfbff05eef93784743c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Sun, 14 Jun 2026 15:05:51 +0200 Subject: [PATCH] CI: add build feed workflow --- .github/workflows/build-feeds.yml | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/build-feeds.yml diff --git a/.github/workflows/build-feeds.yml b/.github/workflows/build-feeds.yml new file mode 100644 index 0000000..b1252d7 --- /dev/null +++ b/.github/workflows/build-feeds.yml @@ -0,0 +1,46 @@ +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 + + - 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/ + + 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