Sync Berkeley classes to Supabase #44
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: Sync Berkeley classes to Supabase | |
| on: | |
| schedule: | |
| - cron: '0 9 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| sync-and-push: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26.x' | |
| - name: Build berkeley-classes | |
| run: go build -o berkeley-classes ./cmd/berkeley-classes | |
| - name: Sync every Fall 2026 section | |
| # Walking the whole term in one search (~290 pages of 20 sections each) | |
| # captures every department, not just the previously hand-picked 16 — | |
| # critical for breadth filter coverage. | |
| run: ./berkeley-classes sync --term 'Fall 2026' --max-pages 400 | |
| - name: Push to Supabase | |
| env: | |
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
| SUPABASE_SERVICE_KEY: ${{ secrets.SUPABASE_SERVICE_KEY }} | |
| run: ./berkeley-classes push --with-snapshots | |
| - name: Ingest course meta from Berkeleytime | |
| env: | |
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
| SUPABASE_SERVICE_KEY: ${{ secrets.SUPABASE_SERVICE_KEY }} | |
| continue-on-error: true | |
| run: ./berkeley-classes ingest-meta --concurrency 4 | |
| - name: Ingest breadth requirements from classes.berkeley.edu | |
| env: | |
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
| SUPABASE_SERVICE_KEY: ${{ secrets.SUPABASE_SERVICE_KEY }} | |
| continue-on-error: true | |
| run: ./berkeley-classes ingest-breadths --term-id 8588 | |
| - name: Notify watch subscribers | |
| env: | |
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
| SUPABASE_SERVICE_KEY: ${{ secrets.SUPABASE_SERVICE_KEY }} | |
| RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} | |
| NOTIFY_FROM_EMAIL: ${{ vars.NOTIFY_FROM_EMAIL }} | |
| NOTIFY_BASE_URL: ${{ vars.NOTIFY_BASE_URL }} | |
| run: ./berkeley-classes notify |