-
Notifications
You must be signed in to change notification settings - Fork 1
299 lines (238 loc) · 9.14 KB
/
deploy-order.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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
name: Basic deploy
on:
push:
branches: [main]
env:
TF_ACTION: apply
AWS_REGION: us-east-1
TF_STATE_BUCKET: bitovi-enterprise-grade-micro-frontends-shared-tf-state
jobs:
create-mfe-builds:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Create Env
run: |
cd ./packages/shell
touch .env
echo MFE_URL_CATALOG=${{ vars.MFE_URL_CATALOG }} >> .env
echo MFE_URL_MARKETING=${{ vars.MFE_URL_MARKETING }} >> .env
echo MFE_URL_ORDER=${{ vars.MFE_URL_ORDER }} >> .env
echo MFE_URL_PROFILE=${{ vars.MFE_URL_PROFILE }} >> .env
echo MFE_URL_WORKSHOP=${{ vars.MFE_URL_WORKSHOP }} >> .env
echo SENTRY_DSN_SHELL=$${{ vars.SENTRY_DSN_SHELL }} >> .env
cat .env
cd ../marketing
touch .env
echo MFE_URL_CATALOG=${{ vars.MFE_URL_CATALOG }} >> .env
echo MFE_URL_ORDER=${{ vars.MFE_URL_ORDER }} >> .env
echo SENTRY_DSN_MARKETING=$${{ vars.SENTRY_DSN_MARKETING }} >> .env
cd ../catalog
touch .env
echo SENTRY_DSN_CATALOG=$${{ vars.SENTRY_DSN_CATALOG }} >> .env
cd ../order
touch .env
echo SENTRY_DSN_ORDER=$${{ vars.SENTRY_DSN_ORDER }} >> .env
cd ../profile
touch .env
echo SENTRY_DSN_PROFILE=$${{ vars.SENTRY_DSN_PROFILE }} >> .env
cd ../workshop
touch .env
echo SENTRY_DSN_WORKSHOP=$${{ vars.SENTRY_DSN_WORKSHOP }} >> .env
- name: Install dependencies
run: |
npm i -g nx
npm i
- name: Build
run: nx run-many -t build --parallel=10
- name: Upload catalog build artifacts
uses: actions/upload-artifact@v3
with:
name: catalog-artifacts
path: packages/catalog/dist
- name: Upload marketing build artifacts
uses: actions/upload-artifact@v3
with:
name: marketing-artifacts
path: packages/marketing/dist
- name: Upload order build artifacts
uses: actions/upload-artifact@v3
with:
name: order-artifacts
path: packages/order/dist
- name: Upload profile build artifacts
uses: actions/upload-artifact@v3
with:
name: profile-artifacts
path: packages/profile/dist
- name: Upload shell build artifacts
uses: actions/upload-artifact@v3
with:
name: shell-artifacts
path: packages/shell/dist
- name: Upload workshop build artifacts
uses: actions/upload-artifact@v3
with:
name: workshop-artifacts
path: packages/workshop/dist
deploy-catalog:
runs-on: ubuntu-latest
needs: [create-mfe-builds]
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: catalog-artifacts
path: packages/catalog/dist
- name: Create deploy-bucket
uses: bitovi/github-actions-deploy-static-site-to-aws@Make-origin-access-unique
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_SANDBOX }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_SANDBOX }}
aws_default_region: ${{ env.AWS_REGION }}
checkout: false
aws_site_source_folder: packages/catalog/dist
tf_state_file_name_append: catalog
tf_action: ${{ env.TF_ACTION }}
tf_state_bucket: ${{ env.TF_STATE_BUCKET }}
tf_state_bucket_destroy: true
aws_site_cdn_enabled: true
aws_r53_domain_name: bitovi-sandbox.com
aws_r53_sub_domain_name: catalog-mfe
aws_r53_create_sub_cert: true
aws_site_bucket_name: catalog-mfe
deploy-marketing:
runs-on: ubuntu-latest
needs: [create-mfe-builds]
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: marketing-artifacts
path: packages/marketing/dist
- name: Create deploy-bucket
uses: bitovi/github-actions-deploy-static-site-to-aws@Make-origin-access-unique
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_SANDBOX }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_SANDBOX }}
aws_default_region: ${{ env.AWS_REGION }}
checkout: false
aws_site_source_folder: packages/marketing/dist
tf_state_file_name_append: marketing
tf_action: ${{ env.TF_ACTION }}
tf_state_bucket: ${{ env.TF_STATE_BUCKET }}
tf_state_bucket_destroy: true
aws_site_cdn_enabled: true
aws_r53_domain_name: bitovi-sandbox.com
aws_r53_sub_domain_name: marketing-mfe
aws_r53_create_sub_cert: true
aws_site_bucket_name: marketing-mfe
deploy-order:
runs-on: ubuntu-latest
needs: [create-mfe-builds]
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: order-artifacts
path: packages/order/dist
- name: Create deploy-bucket
uses: bitovi/github-actions-deploy-static-site-to-aws@Make-origin-access-unique
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_SANDBOX }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_SANDBOX }}
aws_default_region: ${{ env.AWS_REGION }}
checkout: false
aws_site_source_folder: packages/order/dist
tf_state_file_name_append: order
tf_action: ${{ env.TF_ACTION }}
tf_state_bucket: ${{ env.TF_STATE_BUCKET }}
tf_state_bucket_destroy: true
aws_site_cdn_enabled: true
aws_r53_domain_name: bitovi-sandbox.com
aws_r53_sub_domain_name: order-mfe
aws_r53_create_sub_cert: true
aws_site_bucket_name: order-mfe
deploy-profile:
runs-on: ubuntu-latest
needs: [create-mfe-builds]
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: profile-artifacts
path: packages/profile/dist
- name: Create deploy-bucket
uses: bitovi/github-actions-deploy-static-site-to-aws@Make-origin-access-unique
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_SANDBOX }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_SANDBOX }}
aws_default_region: ${{ env.AWS_REGION }}
checkout: false
aws_site_source_folder: packages/profile/dist
tf_state_file_name_append: profile
tf_action: ${{ env.TF_ACTION }}
tf_state_bucket: ${{ env.TF_STATE_BUCKET }}
tf_state_bucket_destroy: true
aws_site_cdn_enabled: true
aws_r53_domain_name: bitovi-sandbox.com
aws_r53_sub_domain_name: profile-mfe
aws_r53_create_sub_cert: true
aws_site_bucket_name: profile-mfe
deploy-shell:
runs-on: ubuntu-latest
needs: [create-mfe-builds]
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: shell-artifacts
path: packages/shell/dist
- name: Create deploy-bucket
uses: bitovi/github-actions-deploy-static-site-to-aws@Make-origin-access-unique
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_SANDBOX }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_SANDBOX }}
aws_default_region: ${{ env.AWS_REGION }}
checkout: false
aws_site_source_folder: packages/shell/dist
tf_state_file_name_append: shell
tf_action: ${{ env.TF_ACTION }}
tf_state_bucket: ${{ env.TF_STATE_BUCKET }}
tf_state_bucket_destroy: true
aws_site_cdn_enabled: true
aws_r53_domain_name: bitovi-sandbox.com
aws_r53_sub_domain_name: micro-frontend-workshop
aws_r53_create_sub_cert: true
aws_site_bucket_name: micro-frontend-workshop
deploy-workshop:
runs-on: ubuntu-latest
needs: [create-mfe-builds]
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: workshop-artifacts
path: packages/workshop/dist
- name: Create deploy-bucket
uses: bitovi/github-actions-deploy-static-site-to-aws@Make-origin-access-unique
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_SANDBOX }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_SANDBOX }}
aws_default_region: ${{ env.AWS_REGION }}
checkout: false
aws_site_source_folder: packages/workshop/dist
tf_action: ${{ env.TF_ACTION }}
tf_state_bucket: ${{ env.TF_STATE_BUCKET }}
tf_state_bucket_destroy: true
tf_state_file_name_append: workshop
aws_site_cdn_enabled: true
aws_r53_domain_name: bitovi-sandbox.com
aws_r53_sub_domain_name: workshop-mfe
aws_r53_create_sub_cert: true
aws_site_bucket_name: workshop-mfe