-
Notifications
You must be signed in to change notification settings - Fork 14
67 lines (57 loc) · 1.9 KB
/
ci.yml
File metadata and controls
67 lines (57 loc) · 1.9 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
60
61
62
63
64
65
66
67
name: CI
on:
workflow_dispatch:
push:
branches:
- main
- dev
jobs:
integration-test:
runs-on: blacksmith-32vcpu-ubuntu-2404
env:
NGROK_AUTHTOKEN: ${{ secrets.NGROK_AUTHTOKEN }}
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
SPACES_KEY_V2: ${{ secrets.SPACES_KEY }}
SPACES_SECRET_V2: ${{ secrets.SPACES_SECRET }}
LOGFIRE_TOKEN: ${{ secrets.LOGFIRE_TOKEN }}
AUTUMN_SECRET_KEY: ${{ secrets.AUTUMN_SECRET_KEY }}
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: useblacksmith/setup-docker-builder@v1
- name: Build containers
run: docker compose -f docker-compose.test.yml build
- name: Run tests
env:
DB_HOST: postgres
REDIS_HOST: serverless-redis-http
CH_HOST: clickhouse
NGROK_HOST: ngrok
run: docker compose -f docker-compose.test.yml up --exit-code-from app --remove-orphans
- name: Logs on failure
if: failure()
run: docker compose -f docker-compose.test.yml logs
- name: Cleanup
if: always()
run: docker compose -f docker-compose.test.yml down -v
migrate:
needs: integration-test
runs-on: blacksmith-32vcpu-ubuntu-2404
# drop the "contains" portion, since we already filter at top-level
if: github.ref_name == 'main' || github.ref_name == 'dev'
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'dev' }}
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run database migrations
run: bun run migrate-production
env:
DATABASE_URL: ${{ env.DATABASE_URL }}