-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (108 loc) · 3.68 KB
/
ci.yaml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: CI
on:
pull_request:
permissions:
contents: read
jobs:
orchestrator:
name: Orchestrator
runs-on: ubuntu-latest
outputs:
should-build-app: ${{ steps.changed-api-files.outputs.any_changed == 'true' || steps.changed-selfserve-files.outputs.any_changed == 'true' || steps.changed-internal-files.outputs.any_changed == 'true' || null }}
should-build-app-api: ${{ steps.changed-api-files.outputs.any_changed == 'true' || null }}
should-build-app-selfserve: ${{ steps.changed-selfserve-files.outputs.any_changed == 'true' || null }}
should-build-app-internal: ${{ steps.changed-internal-files.outputs.any_changed == 'true' || null }}
should-build-docs: ${{ steps.changed-website-files.outputs.any_changed == 'true' || null }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: tj-actions/changed-files@v42
id: changed-api-files
with:
files: |
app/api/**
# since_last_remote_commit: true
- uses: tj-actions/changed-files@v42
id: changed-selfserve-files
with:
files: |
app/selfserve/**
# since_last_remote_commit: true
- uses: tj-actions/changed-files@v42
id: changed-internal-files
with:
files: |
app/internal/**
# since_last_remote_commit: true
- uses: tj-actions/changed-files@v42
id: changed-website-files
with:
files: |
website/**
docs/**
since_last_remote_commit: true
docs:
name: Documentation
if: ${{ needs.orchestrator.outputs.should-build-docs }}
needs:
- orchestrator
uses: ./.github/workflows/deploy-documentation.yaml
with:
deploy: false
permissions:
contents: write
get-app-versions:
name: Get latest app version
needs:
- orchestrator
if: ${{ needs.orchestrator.outputs.should-build-app }}
runs-on: ubuntu-latest
outputs:
api: ${{ steps.api-version.outputs.version }}
selfserve: ${{ steps.selfserve-version.outputs.version }}
internal: ${{ steps.internal-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- id: api-version
uses: ./.github/actions/get-app-version
with:
project-path: app/api
- id: selfserve-version
uses: ./.github/actions/get-app-version
with:
project-path: app/selfserve
- id: internal-version
uses: ./.github/actions/get-app-version
with:
project-path: app/internal
app:
name: App
concurrency:
group: app-${{ matrix.project }}-${{ needs.get-app-versions.outputs[matrix.project] }}
needs:
- orchestrator
- get-app-versions
if: ${{ needs.orchestrator.outputs.should-build-app }}
strategy:
fail-fast: false
matrix:
project:
- api
- selfserve
- internal
exclude:
- project: ${{ needs.orchestrator.outputs.should-build-app-api && 'ignored' || 'api' }}
- project: ${{ needs.orchestrator.outputs.should-build-app-selfserve && 'ignored' || 'selfserve' }}
- project: ${{ needs.orchestrator.outputs.should-build-app-internal && 'ignored' || 'internal' }}
uses: ./.github/workflows/app.yaml
with:
object-prefix: app-${{ matrix.project }}-${{ needs.get-app-versions.outputs[matrix.project] }}
project: ${{ matrix.project }}
should-upload: ${{ contains(github.event.pull_request.labels.*.name, 'deployed') }}
permissions:
contents: read
id-token: write