Dr. Longevity - Automated Data Sync #32
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: Dr. Longevity - Automated Data Sync | |
| on: | |
| # Schedule to run twice daily | |
| schedule: | |
| - cron: '0 6 * * *' # 6 AM UTC (Midnight CST) | |
| - cron: '0 18 * * *' # 6 PM UTC (Noon CST) | |
| # Allow manual trigger from Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install garminconnect garth python-dotenv supabase | |
| - name: Sync health data | |
| env: | |
| GARMIN_EMAIL: ${{ secrets.GARMIN_EMAIL }} | |
| GARMIN_PASSWORD: ${{ secrets.GARMIN_PASSWORD }} | |
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
| SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} | |
| SYNC_DAYS: 7 # Only sync last 7 days for scheduled runs | |
| run: | | |
| python3 dr_longevity_sync_improved.py | |
| - name: Notify on failure | |
| if: failure() | |
| run: | | |
| echo "❌ Garmin sync failed! Check the logs above." | |
| exit 1 |