Update Dashboard Data #100
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: Update Dashboard Data | |
| on: | |
| schedule: | |
| # Taeglich 18:15 UTC (20:15 CEST) — Tankerkoenig-CSV des Vortags ist | |
| # zu dieser Zeit zuverlaessig hochgeladen. Frueheres Cron-Slot (06:15) | |
| # erwischte das Vortags-CSV oft noch nicht und Connection-Refused | |
| # erzeugte 1-2 Tage Lag im Dashboard. | |
| - cron: '15 18 * * *' | |
| workflow_dispatch: # Manuell triggerbar | |
| permissions: | |
| contents: write | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.1.0 | |
| - name: Set up Python 3.12 | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Restore DuckDB cache | |
| uses: actions/cache@v5.0.5 | |
| with: | |
| path: data/fuel_monitor.duckdb | |
| key: duckdb-${{ github.run_number }} | |
| restore-keys: duckdb- | |
| # 60 Tage Ingest-Fenster — Tankerkoenig blockt CSVs aelter als ~2 | |
| # Monate via data.tankerkoenig.de (Retention-Policy), groessere | |
| # Fenster bringen nur Connection-Refused-Spam. Bereits ingestete | |
| # Tage werden via ingestion_log uebersprungen, idempotent. | |
| - name: Ingest last 60 days + Brent | |
| env: | |
| TANKERKOENIG_DATA_USER: ${{ secrets.TANKERKOENIG_DATA_USER }} | |
| TANKERKOENIG_DATA_PASS: ${{ secrets.TANKERKOENIG_DATA_PASS }} | |
| CRUDE_PRICE_API_KEY: ${{ secrets.CRUDE_PRICE_API_KEY }} | |
| run: | | |
| uv run fuel-price-monitor ingest --days 60 | |
| uv run fuel-price-monitor ingest --brent | |
| - name: Export ALL months with data (refreshes index.json) | |
| run: | | |
| uv run fuel-price-monitor export --all-months | |
| - name: Commit and push if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add docs/data/dashboard-*.json docs/data/index.json | |
| git diff --cached --quiet || git commit -m "data: update dashboards $(date -u +%Y-%m-%d)" | |
| git push |