Daily AI Run Coach #22
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: Daily AI Run Coach | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # 這裡使用的是 UTC 時間,0 1 * * * 代表 UTC 凌晨 1 點,也就是台灣時間早上 9 點 | |
| - cron: '0 1 * * *' | |
| jobs: | |
| sync_garmin_to_sheets: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Dependencies | |
| # 新增了 gspread 與 google-auth | |
| run: pip install garminconnect garth gspread google-auth | |
| - name: Run Data Sync Script | |
| env: | |
| GARMIN_HASH: ${{ secrets.GARMIN_HASH }} | |
| GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }} | |
| LINE_CHANNEL_ACCESS_TOKEN: ${{ secrets.LINE_CHANNEL_ACCESS_TOKEN }} | |
| LINE_USER_ID: ${{ secrets.LINE_USER_ID }} | |
| run: | | |
| python coach.py |