Atrium agents, 5-minute cron loop #290
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: Atrium agents, 5-minute cron loop | |
| on: | |
| schedule: | |
| - cron: '*/5 * * * *' | |
| workflow_dispatch: {} | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| tick: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Sanity, required secrets present | |
| run: | | |
| test -n "${{ secrets.AGENTS_BASE_URL }}" || { echo 'AGENTS_BASE_URL secret missing'; exit 1; } | |
| test -n "${{ secrets.CRON_SECRET }}" || { echo 'CRON_SECRET secret missing'; exit 1; } | |
| - name: Tick augur / haruspex / auspex in parallel | |
| env: | |
| BASE: ${{ secrets.AGENTS_BASE_URL }} | |
| AUTH: 'Bearer ${{ secrets.CRON_SECRET }}' | |
| run: | | |
| set -e | |
| ( curl -sS -o /dev/null -w "augur %{http_code}\n" -H "Authorization: $AUTH" "$BASE/api/augur" ) & | |
| ( curl -sS -o /dev/null -w "haruspex %{http_code}\n" -H "Authorization: $AUTH" "$BASE/api/haruspex" ) & | |
| ( curl -sS -o /dev/null -w "auspex %{http_code}\n" -H "Authorization: $AUTH" "$BASE/api/auspex" ) & | |
| wait | |
| - name: Notify ops on failure | |
| if: failure() | |
| run: | | |
| curl -X POST -H 'Content-Type: application/json' \ | |
| -d "{\"content\":\"⚠️ ${{ github.workflow }} failed on ${{ github.ref_name }}: ${{ github.run_id }}\"}" \ | |
| $DISCORD_OPS_WEBHOOK | |
| env: | |
| DISCORD_OPS_WEBHOOK: ${{ secrets.DISCORD_OPS_WEBHOOK }} |