-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (78 loc) · 2.21 KB
/
ci.yml
File metadata and controls
90 lines (78 loc) · 2.21 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
90
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
deployments: write
pull-requests: write
statuses: write
jobs:
changes:
runs-on: ubuntu-latest
outputs:
web: ${{ steps.filter.outputs.web }}
api: ${{ steps.filter.outputs.api }}
sdk: ${{ steps.filter.outputs.sdk }}
docs: ${{ steps.filter.outputs.docs }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
web:
- 'apps/web/**'
- 'packages/ui/**'
api:
- 'apps/api/**'
- 'packages/db/**'
sdk:
- 'sdk/**'
- 'packages/evaluation-core/**'
docs:
- 'apps/docs/**'
test:
needs: changes
runs-on: ubuntu-latest
env:
DATABASE_URL: "postgresql://test:test@localhost:5432/test"
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
- name: Lint
run: pnpm lint
- name: Type Check
run: pnpm check-types
- name: Build All Packages
run: pnpm build
deploy-frontend:
needs: [test, changes]
if: github.ref == 'refs/heads/main' && (needs.changes.outputs.web == 'true' || needs.changes.outputs.sdk == 'true')
uses: ./.github/workflows/deploy-frontend.yml
secrets: inherit
deploy-api:
needs: [test, changes]
if: github.ref == 'refs/heads/main' && needs.changes.outputs.api == 'true'
uses: ./.github/workflows/deploy-api.yml
secrets: inherit
deploy-worker:
needs: [test, changes]
if: github.ref == 'refs/heads/main' && needs.changes.outputs.api == 'true'
uses: ./.github/workflows/deploy-worker.yml
secrets: inherit
deploy-docs:
needs: [test, changes]
if: github.ref == 'refs/heads/main' && (needs.changes.outputs.docs == 'true')
uses: ./.github/workflows/deploy-docs.yml
secrets: inherit