-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 1.36 KB
/
Copy pathci.yml
File metadata and controls
59 lines (48 loc) · 1.36 KB
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
51
52
53
54
55
56
57
58
59
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync
- name: Check formatting with ruff
run: uv run ruff check backend/
- name: Run tests
run: uv run pytest backend/tests/ -v --tb=short
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
APP_ENV: test
docker-build:
runs-on: ubuntu-latest
needs: lint-and-test
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push backend image
uses: docker/build-push-action@v5
with:
context: .
file: backend/Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/eada-backend:latest