-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.11 KB
/
ci-cd.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: CI/CD
on:
push:
branches:
- main
- develop
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
env:
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install Modal
run: |
python -m pip install --upgrade pip
pip install modal
- name: Set environment
id: vars
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "::set-output name=environment::main"
else
echo "::set-output name=environment::dev"
fi
- name: Deploy cutout generator job
run: |
modal deploy --env=${{ steps.vars.outputs.environment }} app.cutout_handler::cutout_handler_stub
- name: Deploy s3_handler job
run: |
modal deploy --env=${{ steps.vars.outputs.environment }} app.s3_handler.app