-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (163 loc) · 6.54 KB
/
cd-pipeline.yml
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
### Pipeline with 3 jobs:
### - semantic versioning
### - release
### - deploy
name: Release and Deploy
on:
push:
branches: [ master ]
jobs:
SemanticVersioning:
name: SemanticVersioning
runs-on: ubuntu-latest
environment: prod
outputs:
grafana_changed: ${{ steps.grafana-versioning.outputs.changed }}
grafana_version_tag: ${{ steps.grafana-versioning.outputs.version_tag }}
backend_changed: ${{ steps.backend-versioning.outputs.changed }}
backend_version_tag: ${{ steps.backend-versioning.outputs.version_tag }}
backend_rust_changed: ${{ steps.backend-rust-versioning.outputs.changed }}
backend_rust_version_tag: ${{ steps.backend-rust-versioning.outputs.version_tag }}
client_changed: ${{ steps.client-versioning.outputs.changed }}
client_version_tag: ${{ steps.client-versioning.outputs.version_tag }}
frontend_changed: ${{ steps.frontend-versioning.outputs.changed }}
frontend_version_tag: ${{ steps.frontend-versioning.outputs.version_tag }}
database_changed: ${{ steps.database-versioning.outputs.changed }}
database_version_tag: ${{ steps.database-versioning.outputs.version_tag }}
prometheus_changed: ${{ steps.prometheus-versioning.outputs.changed }}
prometheus_version_tag: ${{ steps.prometheus-versioning.outputs.version_tag }}
monitoring_changed: ${{ steps.monitoring-versioning.outputs.changed }}
monitoring_version_tag: ${{ steps.monitoring-versioning.outputs.version_tag }}
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
with:
fetch-depth: 0
- name: Backend Version
id: backend-versioning
uses: paulhatch/semantic-version@a8f8f59fd7f0625188492e945240f12d7ad2dca3 #v5.4.0
with:
change_path: "backend"
namespace: backend
major_pattern: "breaking"
minor_pattern: "feat"
- name: Backend Rust Version
id: backend-rust-versioning
uses: paulhatch/semantic-version@a8f8f59fd7f0625188492e945240f12d7ad2dca3 #v5.4.0
with:
change_path: "backend-rust"
namespace: backend-rust
major_pattern: "breaking"
minor_pattern: "feat"
- name: Frontend Version
id: frontend-versioning
uses: paulhatch/semantic-version@a8f8f59fd7f0625188492e945240f12d7ad2dca3 #v5.4.0
with:
change_path: "frontend"
namespace: frontend
major_pattern: "breaking"
minor_pattern: "feat"
- name: Database Version
id: database-versioning
uses: paulhatch/semantic-version@a8f8f59fd7f0625188492e945240f12d7ad2dca3 #v5.4.0
with:
change_path: "database"
namespace: database
major_pattern: "breaking"
minor_pattern: "feat"
- name: Monitoring Version
id: monitoring-versioning
uses: paulhatch/semantic-version@a8f8f59fd7f0625188492e945240f12d7ad2dca3 #v5.4.0
with:
change_path: "monitoring"
namespace: monitoring
major_pattern: "breaking"
minor_pattern: "feat"
BackendRelease:
needs: SemanticVersioning
uses: ./.github/workflows/release.yml
with:
tag: ${{needs.SemanticVersioning.outputs.backend_version_tag}}
enabled: ${{needs.SemanticVersioning.outputs.backend_changed}}
BackendBuildAndPush:
needs: [ SemanticVersioning, BackendRelease ]
uses: ./.github/workflows/build-push-workflow.yml
with:
version: ${{needs.SemanticVersioning.outputs.backend_version_tag}}
enabled: ${{needs.SemanticVersioning.outputs.backend_changed}}
folder: backend
secrets: inherit
BackendDeployK8s:
needs: [ BackendBuildAndPush ]
uses: ./.github/workflows/deploy_backend.yml
secrets: inherit
BackendApiTest:
needs: [ BackendDeployK8s ]
uses: ./.github/workflows/api_test.yml
secrets: inherit
BackendRustRelease:
needs: SemanticVersioning
uses: ./.github/workflows/release.yml
with:
tag: ${{needs.SemanticVersioning.outputs.backend_rust_version_tag}}
enabled: ${{needs.SemanticVersioning.outputs.backend_rust_changed}}
BackendRustBuildAndPush:
needs: [ SemanticVersioning, BackendRustRelease ]
uses: ./.github/workflows/build-push-workflow.yml
with:
version: ${{needs.SemanticVersioning.outputs.backend_rust_version_tag}}
enabled: ${{needs.SemanticVersioning.outputs.backend_rust_changed}}
folder: backend-rust
secrets: inherit
BackendRustDeployK8s:
needs: [ BackendRustBuildAndPush ]
uses: ./.github/workflows/deploy_backend_rust.yml
secrets: inherit
DatabaseRelease:
needs: SemanticVersioning
uses: ./.github/workflows/release.yml
with:
tag: ${{needs.SemanticVersioning.outputs.database_version_tag}}
enabled: ${{needs.SemanticVersioning.outputs.database_changed}}
DatabaseDeploy:
needs: [ SemanticVersioning, DatabaseRelease ]
uses: ./.github/workflows/deploy_database.yml
with:
version: ${{needs.SemanticVersioning.outputs.database_version_tag}}
enabled: ${{needs.SemanticVersioning.outputs.database_changed}}
secrets: inherit
FrontendRelease:
needs: SemanticVersioning
uses: ./.github/workflows/release.yml
with:
tag: ${{needs.SemanticVersioning.outputs.frontend_version_tag}}
enabled: ${{needs.SemanticVersioning.outputs.frontend_changed}}
FrontendBuildAndPush:
needs: [ SemanticVersioning, FrontendRelease ]
uses: ./.github/workflows/build-push-workflow.yml
with:
version: ${{needs.SemanticVersioning.outputs.frontend_version_tag}}
enabled: ${{needs.SemanticVersioning.outputs.frontend_changed}}
folder: frontend
secrets: inherit
FrontendDeployK8s:
needs: FrontendBuildAndPush
uses: ./.github/workflows/deploy_frontend.yml
with:
version: ${{needs.SemanticVersioning.outputs.frontend_version_tag}}
enabled: ${{needs.SemanticVersioning.outputs.frontend_changed}}
secrets: inherit
MonitoringRelease:
needs: SemanticVersioning
uses: ./.github/workflows/release.yml
with:
tag: ${{needs.SemanticVersioning.outputs.monitoring_version_tag}}
enabled: ${{needs.SemanticVersioning.outputs.monitoring_changed}}
MonitoringDeploy:
needs: [ SemanticVersioning, MonitoringRelease ]
uses: ./.github/workflows/deploy_monitoring_stack.yml
with:
version: ${{needs.SemanticVersioning.outputs.monitoring_version_tag}}
enabled: ${{needs.SemanticVersioning.outputs.monitoring_changed}}
folder: monitoring
secrets: inherit