-
Notifications
You must be signed in to change notification settings - Fork 32
208 lines (204 loc) · 8.54 KB
/
deploy.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
name: deploy
on:
workflow_run:
workflows:
- check
types:
- completed
branches:
- master
# Ensures that only one deploy task per branch/environment will run at a time.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
org-formation:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Get role session name
uses: bhowell2/[email protected]
id: role-session-name
with:
value: GitHubActions-${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_id }}
length_from_end: 64
- 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: ${{ steps.role-session-name.outputs.substring }}
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
# Map a step output to a job output
outputs:
role-session-name: ${{ steps.role-session-name.outputs.substring }}
sceptre-organizations:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::531805629419:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/organizations"
sceptre-admincentral:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::745159704268:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/admincentral"
sceptre-itsandbox:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::804034162148:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/itsandbox"
sceptre-scicomp:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::055273631518:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/scicomp"
sceptre-strides:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::423819316185:role/github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/strides"
sceptre-strides-ampad-workflows:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::751556145034:role/github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/strides-ampad-workflows"
sceptre-scipooldev:
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"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
sceptre-command: "sceptre launch develop --prune --yes"
sceptre-scipoolprod:
needs: [org-formation]
uses: "./.github/workflows/aws-scipool.yaml"
with:
role-to-assume: "arn:aws:iam::237179673806:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/scipool"
sceptre-stridespool:
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"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/scipool"
sceptre-command: "sceptre launch strides --prune --yes"
sceptre-bmgfki:
needs: [org-formation]
uses: "./.github/workflows/aws-scipool.yaml"
with:
role-to-assume: "arn:aws:iam::464102568320:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/scipool"
sceptre-command: "sceptre launch bmgfki --prune --yes"
sceptre-sageit-staging:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::797640923903:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/sageit"
sceptre-command: "sceptre launch staging --prune --yes"
sceptre-sageit-prod:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::797640923903:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/sageit"
sceptre-logcentral:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::231505186444:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/logcentral"
sceptre-synapsedev:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::449435941126:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/synapsedev"
sceptre-synapseprod:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::325565585839:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/synapseprod"
sceptre-bridgedev:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::420786776710:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/bridge"
sceptre-command: "sceptre launch develop --prune --yes"
sceptre-bridgeprod:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::649232250620:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/bridge"
sceptre-imagecentral:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::867686887310:role/sagebase-github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/imagecentral"
sceptre-aws-opendata:
needs: [org-formation]
uses: "./.github/workflows/aws-deploy.yaml"
with:
role-to-assume: "arn:aws:iam::373143421983:role/github-oidc-sage-bionetworks-it"
role-session-name: ${{ needs.org-formation.outputs.role-session-name }}
working-dir: "sceptre/aws-opendata"