Skip to content

Update Worker Telemetry #288

Update Worker Telemetry

Update Worker Telemetry #288

name: Update Worker Telemetry
on:
schedule:
- cron: "0 6 * * *" # 06:00 UTC
- cron: "0 18 * * *" # 18:00 UTC
workflow_dispatch: # trigger manuale
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install requests
- name: Fetch and flatten new events
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
run: python scripts/worker_telemetry_archiver.py
- name: Install DuckDB
run: |
curl --retry 3 --retry-delay 5 -fsSL https://github.com/duckdb/duckdb/releases/latest/download/duckdb_cli-linux-amd64.zip -o duckdb.zip
unzip duckdb.zip -d /usr/local/bin
chmod +x /usr/local/bin/duckdb
- name: Aggregate daily stats
run: bash scripts/worker_daily_stats.sh
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add data/
git diff --cached --quiet || git commit -m "chore(data): update worker telemetry $(date -u +%Y-%m-%dT%H:%M:%SZ)"
git push