1
- name : talks
1
+ name : Deploy to Pages
2
2
3
- on : push
3
+ on :
4
+ push :
5
+ branches : ['main', 'web']
6
+ workflow_dispatch :
7
+
8
+ concurrency :
9
+ group : ' pages'
10
+ cancel-in-progress : false
4
11
5
12
jobs :
6
13
check-markdown-links :
@@ -12,3 +19,247 @@ jobs:
12
19
- uses : gaurav-nelson/github-action-markdown-link-check@v1
13
20
with :
14
21
config-file : ' .markdown.json'
22
+
23
+ build-cppcon23 :
24
+ runs-on : ubuntu-latest
25
+ steps :
26
+ - name : Checkout
27
+ uses : actions/checkout@v3
28
+ - uses : dorny/paths-filter@v2
29
+ id : changes
30
+ with :
31
+ filters : .github/path-filters.yml
32
+ - name : authenticate to aws
33
+ uses : aws-actions/configure-aws-credentials@v4
34
+ with :
35
+ aws-region : ${{ secrets.AWS_REGION }}
36
+ role-to-assume : ${{ secrets.AWS_ROLE }}
37
+ - name : Setup Node
38
+ uses : actions/setup-node@v3
39
+ if : steps.changes.outputs.cppcon23 == 'true'
40
+ - name : Setup Pages
41
+ uses : actions/configure-pages@v3
42
+ if : steps.changes.outputs.cppcon23 == 'true'
43
+ - name : Install dependencies
44
+ run : |
45
+ npm install
46
+ npm -w slides/cppcon23 install
47
+ if : steps.changes.outputs.cppcon23 == 'true'
48
+ - name : Build slides
49
+ working-directory : ./slides/cppcon23
50
+ run : npm run build -- --base /talks/cppcon23
51
+ if : steps.changes.outputs.cppcon23 == 'true'
52
+ - name : Export slides
53
+ working-directory : ./slides/cppcon23
54
+ run : npm run export
55
+ if : steps.changes.outputs.cppcon23 == 'true'
56
+ - name : Prepare final artifact
57
+ run : |
58
+ mkdir -p ./dist
59
+ mv ./slides/cppcon23/dist ./dist/cppcon23
60
+ mkdir -p ./dist/cppcon23/images
61
+ mv ./slides/cppcon23/images/cppcon-title-page.png ./dist/cppcon23/images
62
+ tar -zcf cppcon23.tar.gz ./dist
63
+ if : steps.changes.outputs.cppcon23 == 'true'
64
+ - name : push api to aws
65
+ run : aws s3 cp cppcon23.tar.gz ${{ secrets.AWS_BUCKET }}/
66
+ if : steps.changes.outputs.cppcon23 == 'true'
67
+ - name : pull api from aws
68
+ run : |
69
+ aws s3 cp ${{ secrets.AWS_BUCKET }}/cppcon23.tar.gz .
70
+ tar -zxf cppcon23.tar.gz .
71
+ if : steps.changes.outputs.cppcon23 == 'false'
72
+ - name : Upload artifact
73
+ uses : actions/upload-artifact@v3
74
+ with :
75
+ name : cppcon23
76
+ path : ${{ github.workspace }}/cppcon23.tar.gz
77
+ retention-days : 1
78
+
79
+ build-cppcon21 :
80
+ runs-on : ubuntu-latest
81
+ steps :
82
+ - name : Checkout
83
+ uses : actions/checkout@v3
84
+ - uses : dorny/paths-filter@v2
85
+ id : changes
86
+ with :
87
+ filters : .github/path-filters.yml
88
+ - name : authenticate to aws
89
+ uses : aws-actions/configure-aws-credentials@v4
90
+ with :
91
+ aws-region : ${{ secrets.AWS_REGION }}
92
+ role-to-assume : ${{ secrets.AWS_ROLE }}
93
+ - name : Setup Node
94
+ uses : actions/setup-node@v3
95
+ if : steps.changes.outputs.cppcon21 == 'true'
96
+ - name : Setup Pages
97
+ uses : actions/configure-pages@v3
98
+ if : steps.changes.outputs.cppcon21 == 'true'
99
+ - name : Install dependencies
100
+ run : |
101
+ npm install
102
+ npm -w slides/cppcon21 install
103
+ if : steps.changes.outputs.cppcon21 == 'true'
104
+ - name : Build slides
105
+ working-directory : ./slides/cppcon21
106
+ run : npm run build -- --base /talks/cppcon21
107
+ if : steps.changes.outputs.cppcon21 == 'true'
108
+ - name : Export slides
109
+ working-directory : ./slides/cppcon21
110
+ run : npm run export
111
+ if : steps.changes.outputs.cppcon21 == 'true'
112
+ - name : Prepare final artifact
113
+ run : |
114
+ mkdir -p ./dist
115
+ mv ./slides/cppcon21/dist ./dist/cppcon21
116
+ mkdir -p ./dist/cppcon21/images
117
+ mv ./slides/cppcon21/images/cppcon-title-page.png ./dist/cppcon21/images
118
+ tar -zcf cppcon21.tar.gz ./dist
119
+ if : steps.changes.outputs.cppcon21 == 'true'
120
+ - name : push api to aws
121
+ run : aws s3 cp cppcon21.tar.gz ${{ secrets.AWS_BUCKET }}/
122
+ if : steps.changes.outputs.cppcon21 == 'true'
123
+ - name : pull api from aws
124
+ run : |
125
+ aws s3 cp ${{ secrets.AWS_BUCKET }}/cppcon21.tar.gz .
126
+ tar -zxf cppcon21.tar.gz .
127
+ if : steps.changes.outputs.cppcon21 == 'false'
128
+ - name : Upload artifact
129
+ uses : actions/upload-artifact@v3
130
+ with :
131
+ name : cppcon21
132
+ path : ${{ github.workspace }}/cppcon21.tar.gz
133
+ retention-days : 1
134
+
135
+ build-bazelcon23 :
136
+ runs-on : ubuntu-latest
137
+ steps :
138
+ - name : Checkout
139
+ uses : actions/checkout@v3
140
+ - uses : dorny/paths-filter@v2
141
+ id : changes
142
+ with :
143
+ filters : .github/path-filters.yml
144
+ - name : authenticate to aws
145
+ uses : aws-actions/configure-aws-credentials@v4
146
+ with :
147
+ aws-region : ${{ secrets.AWS_REGION }}
148
+ role-to-assume : ${{ secrets.AWS_ROLE }}
149
+ - name : Prepare final artifact
150
+ run : |
151
+ mkdir -p ./dist/bazelcon23/images
152
+ mv ./slides/bazelcon23/redirect.html ./dist/bazelcon23/index.html
153
+ mv ./slides/bazelcon23/slides-bazelcon23-pejman.pdf ./dist/bazelcon23/
154
+ mv ./slides/bazelcon23/images/bazelcon-cover.png ./dist/bazelcon23/images/
155
+ tar -zcf bazelcon23.tar.gz ./dist
156
+ if : steps.changes.outputs.bazelcon23 == 'true'
157
+ - name : push api to aws
158
+ run : aws s3 cp bazelcon23.tar.gz ${{ secrets.AWS_BUCKET }}/
159
+ if : steps.changes.outputs.bazelcon23 == 'true'
160
+ - name : pull api from aws
161
+ run : |
162
+ aws s3 cp ${{ secrets.AWS_BUCKET }}/bazelcon23.tar.gz .
163
+ tar -zxf bazelcon23.tar.gz .
164
+ if : steps.changes.outputs.bazelcon23 == 'false'
165
+ - name : Upload artifact
166
+ uses : actions/upload-artifact@v3
167
+ with :
168
+ name : bazelcon23
169
+ path : ${{ github.workspace }}/bazelcon23.tar.gz
170
+ retention-days : 1
171
+
172
+ build-web :
173
+ runs-on : ubuntu-latest
174
+ steps :
175
+ - uses : actions/checkout@v4
176
+ - uses : dorny/paths-filter@v2
177
+ id : changes
178
+ with :
179
+ filters : .github/path-filters.yml
180
+ - name : authenticate to aws
181
+ uses : aws-actions/configure-aws-credentials@v4
182
+ with :
183
+ aws-region : ${{ secrets.AWS_REGION }}
184
+ role-to-assume : ${{ secrets.AWS_ROLE }}
185
+ - uses : actions/setup-node@v4
186
+ with :
187
+ node-version : 20
188
+ cache : ' npm'
189
+ cache-dependency-path : package-lock.json
190
+ - run : npm ci
191
+ - run : npm run build
192
+ - name : Prepare final artifact
193
+ run : |
194
+ mkdir -p ./dist
195
+ mv ./web/out ./dist/
196
+ tar -zcf web.tar.gz ./dist
197
+ - name : push web to aws
198
+ run : aws s3 cp web.tar.gz ${{ secrets.AWS_BUCKET }}/
199
+ if : steps.changes.outputs.web == 'true'
200
+ - name : pull web from aws
201
+ run : |
202
+ aws s3 cp ${{ secrets.AWS_BUCKET }}/web.tar.gz .
203
+ tar -zxf web.tar.gz .
204
+ if : steps.changes.outputs.web == 'false'
205
+ - name : Upload artifact
206
+ uses : actions/upload-artifact@v3
207
+ with :
208
+ name : web
209
+ path : ${{ github.workspace }}/web.tar.gz
210
+ retention-days : 1
211
+
212
+ bundle :
213
+ runs-on : ubuntu-latest
214
+ needs :
215
+ - build-bazelcon23
216
+ - build-cppcon21
217
+ - build-cppcon23
218
+ - build-web
219
+ steps :
220
+ - name : Checkout
221
+ uses : actions/checkout@v3
222
+ - name : Download CppCon21 artifact
223
+ uses : actions/download-artifact@v3
224
+ with :
225
+ name : cppcon21
226
+ path : ${{ github.workspace }}
227
+ - name : Download CppCon23 artifact
228
+ uses : actions/download-artifact@v3
229
+ with :
230
+ name : cppcon23
231
+ path : ${{ github.workspace }}
232
+ - name : Download BazelCon23 artifact
233
+ uses : actions/download-artifact@v3
234
+ with :
235
+ name : bazelcon23
236
+ path : ${{ github.workspace }}
237
+ - name : Download Web artifact
238
+ uses : actions/download-artifact@v3
239
+ with :
240
+ name : web
241
+ path : ${{ github.workspace }}
242
+ - name : Extract artifacts
243
+ run : |
244
+ tar -xf cppcon21.tar.gz
245
+ tar -xf cppcon23.tar.gz
246
+ tar -xf bazelcon23.tar.gz
247
+ tar -xf web.tar.gz
248
+ - name : Upload artifact
249
+ uses : actions/upload-pages-artifact@v1
250
+ with :
251
+ path : ./dist
252
+
253
+ deploy :
254
+ needs : bundle
255
+ environment :
256
+ name : github-pages
257
+ url : ${{ steps.deployment.outputs.page_url }}
258
+ permissions :
259
+ pages : write
260
+ id-token : write
261
+ runs-on : ubuntu-latest
262
+ steps :
263
+ - name : Deploy to GitHub Pages
264
+ id : deployment
265
+ uses : actions/deploy-pages@v2
0 commit comments