From 74cb98fc728019683bcc2edf528f353ca2ab7d8a Mon Sep 17 00:00:00 2001 From: Caleb Bae Date: Wed, 9 Sep 2026 22:46:23 +0000 Subject: [PATCH] ci: deploy Modal service on push to main Runs 'modal deploy run-service/modal_app.py' when a push to main touches run-service/ (or via workflow_dispatch). Needs MODAL_TOKEN_ID and MODAL_TOKEN_SECRET as repository Actions secrets. --- .github/workflows/modal-deploy.yml | 34 ++++++++++++++++++++++++++++++ README.md | 5 +++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/modal-deploy.yml diff --git a/.github/workflows/modal-deploy.yml b/.github/workflows/modal-deploy.yml new file mode 100644 index 0000000..7adb5cf --- /dev/null +++ b/.github/workflows/modal-deploy.yml @@ -0,0 +1,34 @@ +name: Deploy Modal service + +on: + push: + branches: [main] + paths: + - "run-service/**" + workflow_dispatch: + +concurrency: + group: modal-deploy + cancel-in-progress: false + +jobs: + deploy: + runs-on: ubuntu-latest + defaults: + run: + working-directory: run-service + env: + 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.11" + + - run: pip install modal + + - run: python -m py_compile modal_app.py + + - run: modal deploy modal_app.py diff --git a/README.md b/README.md index 3fabdcb..0283aed 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,11 @@ The core separation happens in `run-service/modal_app.py`: Copy the web endpoint URL to your `.env.local`. + **Automatic deploys:** `.github/workflows/modal-deploy.yml` runs `modal deploy` whenever a + push to `main` touches `run-service/` (or manually via *Actions → Deploy Modal service → Run + workflow*). Add `MODAL_TOKEN_ID` and `MODAL_TOKEN_SECRET` as repository Actions secrets + (create a token at https://modal.com/settings/tokens). + To test the service without the frontend: ```bash modal run modal_app.py --path ./sermon.mp3 --out-dir ./out