-
Notifications
You must be signed in to change notification settings - Fork 182
191 lines (153 loc) 路 5.18 KB
/
03-create-todo-app-environment.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
# This workflow deploys all resources that are specific to the Todo-App, but not the app itself.
name: 03 - Manually create the Todo-App environment
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
on:
workflow_dispatch:
inputs:
environmentName:
description: 'The name of the environment in which to deploy the Todo-App-specific environment resources.'
required: true
default: 'staging'
jobs:
deploy-messaging-stack:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
name: Deploy the messaging stack
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: NPM install
working-directory: cdk
run: npm install
- name: Deploy messaging stack
working-directory: cdk
run: npm run messaging:deploy -- -c environmentName=${{ github.event.inputs.environmentName }}
deploy-database-stack:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
name: Deploy the database stack
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: NPM install
working-directory: cdk
run: npm install
- name: Deploy database stack
working-directory: cdk
run: npm run database:deploy -- -c environmentName=${{ github.event.inputs.environmentName }}
deploy-cognito-stack:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
name: Deploy the Cognito stack
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: NPM install
working-directory: cdk
run: npm install
- name: Deploy Cognito stack
working-directory: cdk
run: npm run cognito:deploy -- -c environmentName=${{ github.event.inputs.environmentName }}
deploy-activemq-stack:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
name: Deploy the ActiveMq stack
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: NPM install
working-directory: cdk
run: npm install
- name: Deploy ActiveMq stack
working-directory: cdk
run: npm run activeMq:deploy -- -c environmentName=${{ github.event.inputs.environmentName }}
deploy-sequencer-lambda:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
name: Deploy the Deployment Sequencer
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: NPM install CDK dependencies
working-directory: cdk
run: npm install
- name: NPM install Deployment Sequencer dependencies
working-directory: cdk/deployment-sequencer-lambda
run: npm install
- name: Build Deployment Sequencer
working-directory: cdk/deployment-sequencer-lambda
run: npm run dist
- name: Deploy Deployment Sequencer
working-directory: cdk
run: npm run deployment-sequencer:deploy -- -c environmentName=${{ github.event.inputs.environmentName }} -c githubToken=${{ secrets.GH_API_TOKEN }}
deploy-monitoring-stack:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
name: Deploy the Monitoring stack
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: NPM install
working-directory: cdk
run: npm install
- name: Deploy Monitoring stack
working-directory: cdk
run: npm run monitoring:deploy -- -c environmentName=${{ github.event.inputs.environmentName }}
deploy-canary-stack:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
name: Deploy the Canary stack
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: NPM install
working-directory: cdk
run: npm install
- name: Deploy Canary stack
working-directory: cdk
run: npm run canary:deploy -- -c environmentName=${{ github.event.inputs.environmentName }} -c canaryUserPassword=${{ secrets.CANARY_USER_PASSWORD }}