Snowy Owl Check #710
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: Snowy Owl Check | |
| on: | |
| schedule: | |
| # hourly 6am-6pm EST (11-23 UTC), Oct-Apr only | |
| - cron: "0 11-23 * 1-4 *" | |
| - cron: "0 11-23 * 10-12 *" | |
| workflow_dispatch: | |
| permissions: | |
| actions: write | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: false | |
| - run: uv sync | |
| - name: Restore state cache | |
| id: cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: .snowy-state.json | |
| key: snowy-state | |
| - name: Check for new sightings | |
| env: | |
| EBIRD_API_KEY: ${{ secrets.EBIRD_API_KEY }} | |
| GMAIL_USER: ${{ secrets.GMAIL_USER }} | |
| GMAIL_APP_PASSWORD: ${{ secrets.GMAIL_APP_PASSWORD }} | |
| run: uv run snowy check --to "${{ vars.EMAIL_TO }}" | |
| - name: Delete old state cache | |
| if: steps.cache.outputs.cache-hit == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh cache delete snowy-state | |
| - name: Save state cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: .snowy-state.json | |
| key: snowy-state |