-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (75 loc) · 2.1 KB
/
Copy pathci.yml
File metadata and controls
89 lines (75 loc) · 2.1 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on:
push:
branches:
- main
- master
pull_request:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
quality:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: tgo_network
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d tgo_network"
--health-interval 5s
--health-timeout 5s
--health-retries 20
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/tgo_network
BETTER_AUTH_SECRET: ci-secret-change-me
BETTER_AUTH_URL: http://localhost:8787
CORS_ALLOWED_ORIGINS: http://localhost:4321,http://localhost:5173
INTERNAL_API_TOKEN: ci-internal-api-token
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
version: 10.8.0
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22.x
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: env COREPACK_HOME="$GITHUB_WORKSPACE/.corepack" corepack pnpm install --frozen-lockfile
- name: Validate API environment
run: npm run env:check:api -- internal
- name: Typecheck
run: npm run typecheck
- name: Build
run: npm run build
- name: Test
run: npm run test
docker-api:
runs-on: ubuntu-latest
needs: quality
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build API image
uses: docker/build-push-action@v7
with:
context: .
file: apps/api/Dockerfile
push: false
tags: tgo-api:ci
cache-from: type=gha
cache-to: type=gha,mode=max