-
Notifications
You must be signed in to change notification settings - Fork 32
239 lines (235 loc) · 8.93 KB
/
main.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
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
name: main
on:
pull_request:
branches: ['*']
push:
branches: ['*']
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: pre-commit/[email protected]
jinja-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install jinja libraries
run: |
python -m pip install --upgrade jinja2==3.0.1
- name: Install jinja linter tool
run: git clone --single-branch https://github.com/drm/jinja2-lint.git /tmp/jinja2-lint && pushd /tmp/jinja2-lint && git checkout 75dcd5a
- name: Execute jinja linter
run: find . -type f -name "*.j2" -exec /tmp/jinja2-lint/j2lint.py '{}' +
test-npm-deps: # Useful for testing version updates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install
org-formation:
if: github.ref == 'refs/heads/master'
needs: [pre-commit, jinja-lint, test-npm-deps]
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Assume AWS Role
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::531805629419:role/sagebase-github-oidc-sage-bionetworks-it
role-session-name: GitHubActions-${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_id }}
role-duration-seconds: 1200
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install
- name: Generate AWS CDK bootstrap template
run: npm run generate-cdk-bootstrap-template
- name: Add EnableKeyRotation property to CDK assets key
run: npm run patch-cdk-bootstrap-template
- name: Validate ofn templates
run: npm run validate-tasks
- name: Validate with print-task
run: npm run print-tasks-failfast
- name: Deploy with ofn
run: npm run ci-perform-tasks-parallel
sceptre-organizations:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::531805629419:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/organizations"
sceptre-admincentral:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::745159704268:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/admincentral"
sceptre-itsandbox:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::804034162148:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/itsandbox"
sceptre-scicomp:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::055273631518:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/scicomp"
sceptre-strides:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::423819316185:role/github-oidc-sage-bionetworks-it"
working-dir: "sceptre/strides"
sceptre-strides-ampad-workflows:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::751556145034:role/github-oidc-sage-bionetworks-it"
working-dir: "sceptre/strides-ampad-workflows"
sceptre-scipooldev:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::465877038949:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/scipool"
sceptre-command: "sceptre launch develop --prune --yes"
sceptre-scipoolprod:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-scipool.yaml"
with:
role-to-assume: "arn:aws:iam::237179673806:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/scipool"
sceptre-stridespool:
if: github.ref == 'refs/heads/master'
needs: [org-formation, sceptre-strides]
uses: "./.github/workflows/aws-scipool.yaml"
with:
role-to-assume: "arn:aws:iam::423819316185:role/github-oidc-sage-bionetworks-it"
working-dir: "sceptre/scipool"
sceptre-command: "sceptre launch strides --prune --yes"
sceptre-bmgfki:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-scipool.yaml"
with:
role-to-assume: "arn:aws:iam::464102568320:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/scipool"
sceptre-command: "sceptre launch bmgfki --prune --yes"
sceptre-sageit-staging:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::797640923903:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/sageit"
sceptre-command: "sceptre launch staging --prune --yes"
sceptre-sageit-prod:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::797640923903:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/sageit"
sceptre-logcentral:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::231505186444:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/logcentral"
sceptre-synapsedev:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::449435941126:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/synapsedev"
sceptre-synapseprod:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::325565585839:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/synapseprod"
sceptre-securitycentral:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::140124849929:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/securitycentral"
sceptre-bridgedev:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::420786776710:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/bridge"
sceptre-command: "sceptre launch develop --prune --yes"
sceptre-bridgeprod:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::649232250620:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/bridge"
sceptre-imagecentral:
if: github.ref == 'refs/heads/master'
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::867686887310:role/sagebase-github-oidc-sage-bionetworks-it"
working-dir: "sceptre/imagecentral"