-
Notifications
You must be signed in to change notification settings - Fork 3
221 lines (203 loc) · 6.62 KB
/
ci.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: ci
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
action_type:
description: "Action type"
required: true
type: choice
options:
- extension
- geo
- server
- tiles
- tools
- worker
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
extension: ${{ steps.extension.outputs.any_changed }}
geo: ${{ steps.geo.outputs.any_changed }}
server: ${{ steps.server.outputs.any_changed }}
tiles: ${{ steps.tiles.outputs.any_changed }}
tools: ${{ steps.tools.outputs.any_changed }}
worker: ${{ steps.worker.outputs.any_changed }}
build: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name == 'main' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: changed files for extension
id: extension
uses: tj-actions/changed-files@v36
with:
files: |
extension
.github/workflows/ci-extension.yml
.github/workflows/ci-extension-version-update.yml
.github/workflows/deploy-extension-dev.yml
.github/workflows/deploy-extension-prod.yml
- name: changed files for server
id: server
uses: tj-actions/changed-files@v36
with:
files: |
server
.github/workflows/ci-server.yml
.github/workflows/build-server.yml
.github/workflows/deploy-server-dev.yml
.github/workflows/deploy-server-prod.yml
- name: changed files for tools
id: tools
uses: tj-actions/changed-files@v36
with:
files: |
tools
.github/workflows/ci-tools.yml
- name: changed files for geo
id: geo
uses: tj-actions/changed-files@v36
with:
files: |
geo
.github/workflows/ci-geo.yml
.github/workflows/build-geo.yml
.github/workflows/deploy-geo-dev.yml
.github/workflows/deploy-geo-prod.yml
- name: changed files for tiles
id: tiles
uses: tj-actions/changed-files@v36
with:
files: |
tiles
.github/workflows/ci-tiles.yml
.github/workflows/build-tiles.yml
.github/workflows/deploy-tiles-dev.yml
.github/workflows/deploy-tiles-prod.yml
- name: changed files for worker
id: worker
uses: tj-actions/changed-files@v36
with:
since_last_remote_commit: true
files: |
worker
.github/workflows/ci-worker.yml
.github/workflows/build-worker.yml
.github/workflows/deploy-worker-dev.yml
.github/workflows/deploy-worker-prod.yml
# ci-extension-version-update:
# needs: prepare
# if: ${{ !failure() && needs.prepare.outputs.extension == 'true' && github.event_name == 'push' && github.ref_name == 'main' }}
# uses: ./.github/workflows/ci-extension-version-update.yml
# with:
# commit-sha: ${{ github.sha }}
ci-extension:
needs:
- prepare
# - ci-extension-version-update
if: needs.prepare.outputs.extension == 'true' || github.event.inputs.action_type == 'extension'
uses: ./.github/workflows/ci-extension.yml
ci-tools:
needs: prepare
if: needs.prepare.outputs.tools == 'true' || github.event.inputs.action_type == 'tools'
uses: ./.github/workflows/ci-tools.yml
with:
release_tools: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
ci-geo:
needs: prepare
if: needs.prepare.outputs.geo == 'true' || github.event.inputs.action_type == 'geo'
uses: ./.github/workflows/ci-geo.yml
ci-server:
needs: prepare
if: needs.prepare.outputs.server == 'true' || github.event.inputs.action_type == 'server'
uses: ./.github/workflows/ci-server.yml
ci-tiles:
needs: prepare
if: needs.prepare.outputs.tiles == 'true' || github.event.inputs.action_type == 'tiles'
uses: ./.github/workflows/ci-tiles.yml
ci-worker:
needs: prepare
if: ${{ needs.prepare.outputs.worker == 'true' || github.event.inputs.action_type == 'worker' }}
uses: ./.github/workflows/ci-worker.yml
ci:
runs-on: ubuntu-latest
needs:
- ci-extension
- ci-geo
- ci-server
- ci-tiles
- ci-tools
- ci-worker
if: '!failure()'
steps:
- run: echo OK
deploy-extension-dev:
needs: [prepare, ci-extension]
if: ${{ success() && needs.prepare.outputs.build == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Dispatch deployment
uses: peter-evans/repository-dispatch@v2
with:
event-type: deploy-extension-dev
build-geo:
needs: [prepare, ci-geo]
if: ${{ success() && needs.prepare.outputs.build == 'true' }}
uses: ./.github/workflows/build-geo.yml
deploy-geo-dev:
needs: build-geo
if: ${{ always() && needs.build-geo.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Dispatch deployment
uses: peter-evans/repository-dispatch@v2
with:
event-type: deploy-geo-dev
build-server:
needs:
- prepare
- ci-server
- ci-extension
if: ${{ !failure() && needs.ci-server.result == 'success' && needs.prepare.outputs.build == 'true' }}
uses: ./.github/workflows/build-server.yml
with:
local: ${{ needs.ci-extension.result == 'success' }}
deploy-server-dev:
needs: build-server
if: ${{ always() && needs.build-server.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Dispatch deployment
uses: peter-evans/repository-dispatch@v2
with:
event-type: deploy-server-dev
build-tiles:
needs: [prepare, ci-tiles]
if: ${{ success() && needs.prepare.outputs.build == 'true' }}
uses: ./.github/workflows/build-tiles.yml
deploy-tiles-dev:
needs: build-tiles
if: ${{ always() && needs.build-tiles.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Dispatch deployment
uses: peter-evans/repository-dispatch@v2
with:
event-type: deploy-tiles-dev
build-worker:
needs: [prepare, ci-worker]
if: ${{ success() && needs.prepare.outputs.build == 'true' }}
uses: ./.github/workflows/build-worker.yml
deploy-worker-dev:
needs: build-worker
if: ${{ always() && needs.build-worker.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Dispatch deployment
uses: peter-evans/repository-dispatch@v2
with:
event-type: deploy-worker-dev