-
-
Notifications
You must be signed in to change notification settings - Fork 21
45 lines (38 loc) · 1.05 KB
/
deploy-modal.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Deploy fastapi
on:
push:
branches:
- main
paths:
- "code-plugin/main.py"
jobs:
deploy:
name: Deploy example app
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
env:
MODAL_TOKEN_ID: ${{ secrets.MODAL_MODAL_LABS_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_MODAL_LABS_TOKEN_SECRET }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Cache Poetry
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install dependencies
run: |
cd code-plugin
poetry install
- name: Deploy FastAPI app to Modal
run: |
cd code-plugin
poetry run modal deploy main.py