semantique / .github /workflows /deploy-modal.yml
Ben Blaker
ci(modal): auto-deploy the judge on push to main (#34)
17c3e5f unverified
Raw
History Blame Contribute Delete
1.1 kB
name: Deploy Modal judge
# A deployed Modal app is a snapshot of the code at `modal deploy` time, so the
# GPU judge only updates when we redeploy. Do it automatically when modal_judge.py
# lands on main. The stable *.modal.run URL is unchanged by redeploys, so the HF
# Space's MODAL_JUDGE_URL secret keeps working without coordination.
on:
push:
branches: [main]
paths: ['modal_judge.py'] # skip redeploys for unrelated UI/audio commits
workflow_dispatch: {} # allow manual redeploys (e.g. to force an image rebuild)
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
env:
# Repo secrets β€” Modal dashboard β†’ Settings β†’ API Tokens (`modal token new`).
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
# The runner only needs the CLI; torch/transformers build remotely on Modal.
- run: pip install modal
- run: modal deploy modal_judge.py