Keepers Schedule #47
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: Keepers Schedule | |
| # Replaces vercel.json's crons array (#513): Vercel's Hobby plan only allows | |
| # daily cron jobs, so neither the accrual keeper's 15-minute schedule nor the | |
| # migration keeper's hourly one could actually run there. GitHub Actions' | |
| # schedule trigger has no such restriction. | |
| # | |
| # Three schedule entries fire three independent workflow runs on their own | |
| # cadence; each run only triggers the step matching its own schedule | |
| # (github.event.schedule), so a tick where several crons coincide (every | |
| # hour, on the hour) still calls each matching endpoint exactly once, not | |
| # one call doing double duty. | |
| on: | |
| schedule: | |
| - cron: "*/5 * * * *" # admin-event alert keeper | |
| - cron: "*/15 * * * *" # accrual keeper | |
| - cron: "0 * * * *" # migration keeper | |
| workflow_dispatch: # manual trigger for debugging | |
| jobs: | |
| trigger-keepers: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger alert keeper | |
| if: github.event.schedule == '*/5 * * * *' || github.event_name == 'workflow_dispatch' | |
| run: | | |
| curl -sf -X POST "${{ vars.API_BASE_URL }}/api/v1/keepers/alert" \ | |
| -H "Authorization: Bearer ${{ secrets.CRON_SECRET }}" | |
| - name: Trigger accrual keeper | |
| if: github.event.schedule == '*/15 * * * *' || github.event_name == 'workflow_dispatch' | |
| run: | | |
| curl -sf -X POST "${{ vars.API_BASE_URL }}/api/v1/keepers/accrue" \ | |
| -H "Authorization: Bearer ${{ secrets.CRON_SECRET }}" | |
| - name: Trigger migration keeper | |
| if: github.event.schedule == '0 * * * *' || github.event_name == 'workflow_dispatch' | |
| run: | | |
| curl -sf -X POST "${{ vars.API_BASE_URL }}/api/v1/keepers/rebalance" \ | |
| -H "Authorization: Bearer ${{ secrets.CRON_SECRET }}" |