Ben Blaker Claude Opus 4.8 (1M context) commited on
Commit
17c3e5f
·
unverified ·
1 Parent(s): 9bca9a5

ci(modal): auto-deploy the judge on push to main (#34)

Browse files

A deployed Modal app is a snapshot of the code at `modal deploy` time, so the
GPU judge doesn't update until it's redeployed. Wire that into CI: on push to
main touching modal_judge.py (and via manual workflow_dispatch), run
`modal deploy modal_judge.py`.

- Path-filtered to modal_judge.py so unrelated UI/audio commits don't trigger
pointless redeploys.
- Runner only installs the `modal` CLI; torch/transformers build remotely on
Modal's builders, so the job is cheap.
- The stable *.modal.run URL is unchanged by redeploys, so the HF Space's
MODAL_JUDGE_URL secret needs no coordination.

Requires repo secrets MODAL_TOKEN_ID / MODAL_TOKEN_SECRET (Modal dashboard →
Settings → API Tokens).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. .github/workflows/deploy-modal.yml +28 -0
.github/workflows/deploy-modal.yml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Deploy Modal judge
2
+
3
+ # A deployed Modal app is a snapshot of the code at `modal deploy` time, so the
4
+ # GPU judge only updates when we redeploy. Do it automatically when modal_judge.py
5
+ # lands on main. The stable *.modal.run URL is unchanged by redeploys, so the HF
6
+ # Space's MODAL_JUDGE_URL secret keeps working without coordination.
7
+ on:
8
+ push:
9
+ branches: [main]
10
+ paths: ['modal_judge.py'] # skip redeploys for unrelated UI/audio commits
11
+ workflow_dispatch: {} # allow manual redeploys (e.g. to force an image rebuild)
12
+
13
+ jobs:
14
+ deploy:
15
+ name: Deploy
16
+ runs-on: ubuntu-latest
17
+ env:
18
+ # Repo secrets — Modal dashboard → Settings → API Tokens (`modal token new`).
19
+ MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
20
+ MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.12"
26
+ # The runner only needs the CLI; torch/transformers build remotely on Modal.
27
+ - run: pip install modal
28
+ - run: modal deploy modal_judge.py