-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1011 Bytes
/
ci-cd.yml
File metadata and controls
50 lines (42 loc) · 1011 Bytes
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
46
47
48
49
50
name: CI/CD
on:
push:
branches:
- main
paths:
- 'src/**'
- 'tests/**'
- '*.py'
- 'requirements.txt'
- 'pyproject.toml'
- 'Dockerfile'
- '.github/workflows/ci-cd.yml'
tags:
- 'v*'
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@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install modal httpx fastapi pytest pytest-asyncio
- name: Run tests
run: pytest tests/ -v
- name: Lint with ruff
run: |
pip install ruff
ruff check app.py
- name: Deploy job
run: |
modal deploy app.py