Data Export #121
This file contains 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: Data Export | |
on: | |
schedule: | |
- cron: '0 5 * * *' # Runs daily at 5:00 UTC | |
- cron: '0 17 * * *' # Runs daily at 17:00 UTC | |
workflow_dispatch: # Allows manual trigger | |
jobs: | |
export-data: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Important for git history | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pandas numpy supabase python-dotenv | |
- name: Process FPL data | |
env: | |
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} | |
run: python scripts/export_data.py | |
- name: Commit and push changes (Data Export) | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add data/ | |
git diff --quiet && git diff --staged --quiet || (git commit -m "Auto-update FPL data $(date +'%Y-%m-%d %H:%M UTC')" && git push) |