-
-
Notifications
You must be signed in to change notification settings - Fork 5
498 lines (442 loc) · 27.5 KB
/
main.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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
name: Main cacheKeys workflow
on:
workflow_dispatch:
jobs:
getRepoCacheVars:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Print all var names before change
run: |
echo "ALTERNATE_BIOMES_CACHEKEY is ${{ vars.ALTERNATE_BIOMES_CACHEKEY }}"
echo "APOTHEOSIS_CACHEKEY is ${{ vars.APOTHEOSIS_CACHEKEY }}"
echo "APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY is ${{ vars.APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY }}"
echo "APOTHEOSIS_TUONELA_CACHEKEY is ${{ vars.APOTHEOSIS_TUONELA_CACHEKEY }}"
echo "NEW_GAME_PLUS_HD_CACHEKEY is ${{ vars.NEW_GAME_PLUS_HD_CACHEKEY }}"
echo "NIGHTMARE_HD_CACHEKEY is ${{ vars.NIGHTMARE_HD_CACHEKEY }}"
echo "NOITAVANIA_CACHEKEY is ${{ vars.NOITAVANIA_CACHEKEY }}"
echo "NOITAVANIA_NEW_GAME_PLUS_CACHEKEY is ${{ vars.NOITAVANIA_NEW_GAME_PLUS_CACHEKEY }}"
echo "PURGATORY_CACHEKEY is ${{ vars.PURGATORY_CACHEKEY }}"
echo "REGULAR_LEFT_PW_CACHEKEY is ${{ vars.REGULAR_LEFT_PW_CACHEKEY }}"
echo "REGULAR_MAIN_BRANCH_CACHEKEY is ${{ vars.REGULAR_MAIN_BRANCH_CACHEKEY }}"
echo "REGULAR_MIDDLE_CACHEKEY is ${{ vars.REGULAR_MIDDLE_CACHEKEY }}"
echo "REGULAR_RIGHT_PW_CACHEKEY is ${{ vars.REGULAR_RIGHT_PW_CACHEKEY }}"
- name: ALTERNATE_BIOMES_CACHEKEY
run: echo "current ALTERNATE_BIOMES_CACHEKEY = ${{ env.ALTERNATE_BIOMES_CACHEKEY }}"
- name: Get CF deployment for ALTERNATE_BIOMES_CACHEKEY
id: get_cf_deployments_ALTERNATE_BIOMES
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.ALTERNATE_BIOMES_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for ALTERNATE_BIOMES_CACHEKEY
id: get_modified_on_ALTERNATE_BIOMES
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_ALTERNATE_BIOMES.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for ALTERNATE_BIOMES_CACHEKEY
id: gh_cachekey_update_ALTERNATE_BIOMES
run: |
PROJECT_CACHEKEY_VAR="ALTERNATE_BIOMES_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_ALTERNATE_BIOMES.outputs.modified_on }}\"}"
- name: APOTHEOSIS_CACHEKEY
run: echo "current APOTHEOSIS_CACHEKEY = ${{ env.APOTHEOSIS_CACHEKEY }}"
- name: Get CF deployment for APOTHEOSIS_CACHEKEY
id: get_cf_deployments_APOTHEOSIS
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.APOTHEOSIS_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for APOTHEOSIS_CACHEKEY
id: get_modified_on_APOTHEOSIS
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_APOTHEOSIS.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for APOTHEOSIS_CACHEKEY
id: gh_cachekey_update_APOTHEOSIS
run: |
PROJECT_CACHEKEY_VAR="APOTHEOSIS_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_APOTHEOSIS.outputs.modified_on }}\"}"
- name: APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY
run: echo "current APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY = ${{ env.APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY }}"
- name: Get CF deployment for APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY
id: get_cf_deployments_APOTHEOSIS_NEW_GAME_PLUS
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.APOTHEOSIS_NEW_GAME_PLUS_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY
id: get_modified_on_APOTHEOSIS_NEW_GAME_PLUS
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_APOTHEOSIS_NEW_GAME_PLUS.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY
id: gh_cachekey_update_APOTHEOSIS_NEW_GAME_PLUS
run: |
PROJECT_CACHEKEY_VAR="APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_APOTHEOSIS_NEW_GAME_PLUS.outputs.modified_on }}\"}"
- name: APOTHEOSIS_TUONELA_CACHEKEY
run: echo "current APOTHEOSIS_TUONELA_CACHEKEY = ${{ env.APOTHEOSIS_TUONELA_CACHEKEY }}"
- name: Get CF deployment for APOTHEOSIS_TUONELA_CACHEKEY
id: get_cf_deployments_APOTHEOSIS_TUONELA
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.APOTHEOSIS_TUONELA_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for APOTHEOSIS_TUONELA_CACHEKEY
id: get_modified_on_APOTHEOSIS_TUONELA
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_APOTHEOSIS_TUONELA.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for APOTHEOSIS_TUONELA_CACHEKEY
id: gh_cachekey_update_APOTHEOSIS_TUONELA
run: |
PROJECT_CACHEKEY_VAR="APOTHEOSIS_TUONELA_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_APOTHEOSIS_TUONELA.outputs.modified_on }}\"}"
- name: NEW_GAME_PLUS_HD_CACHEKEY
run: echo "current NEW_GAME_PLUS_HD_CACHEKEY = ${{ env.NEW_GAME_PLUS_HD_CACHEKEY }}"
- name: Get CF deployment for NEW_GAME_PLUS_HD_CACHEKEY
id: get_cf_deployments_NEW_GAME_PLUS_HD
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.NEW_GAME_PLUS_HD_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for NEW_GAME_PLUS_HD_CACHEKEY
id: get_modified_on_NEW_GAME_PLUS_HD
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_NEW_GAME_PLUS_HD.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for NEW_GAME_PLUS_HD_CACHEKEY
id: gh_cachekey_update_NEW_GAME_PLUS_HD
run: |
PROJECT_CACHEKEY_VAR="NEW_GAME_PLUS_HD_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_NEW_GAME_PLUS_HD.outputs.modified_on }}\"}"
- name: NIGHTMARE_HD_CACHEKEY
run: echo "current NIGHTMARE_HD_CACHEKEY = ${{ env.NIGHTMARE_HD_CACHEKEY }}"
- name: Get CF deployment for NIGHTMARE_HD_CACHEKEY
id: get_cf_deployments_NIGHTMARE_HD
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.NIGHTMARE_HD_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for NIGHTMARE_HD_CACHEKEY
id: get_modified_on_NIGHTMARE_HD
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_NIGHTMARE_HD.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for NIGHTMARE_HD_CACHEKEY
id: gh_cachekey_update_NIGHTMARE_HD
run: |
PROJECT_CACHEKEY_VAR="NIGHTMARE_HD_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_NIGHTMARE_HD.outputs.modified_on }}\"}"
- name: NOITAVANIA_CACHEKEY
run: echo "current NOITAVANIA_CACHEKEY = ${{ env.NOITAVANIA_CACHEKEY }}"
- name: Get CF deployment for NOITAVANIA_CACHEKEY
id: get_cf_deployments_NOITAVANIA
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.NOITAVANIA_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for NOITAVANIA_CACHEKEY
id: get_modified_on_NOITAVANIA
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_NOITAVANIA.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for NOITAVANIA_CACHEKEY
id: gh_cachekey_update_NOITAVANIA
run: |
PROJECT_CACHEKEY_VAR="NOITAVANIA_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_NOITAVANIA.outputs.modified_on }}\"}"
- name: NOITAVANIA_NEW_GAME_PLUS_CACHEKEY
run: echo "current NOITAVANIA_NEW_GAME_PLUS_CACHEKEY = ${{ env.NOITAVANIA_NEW_GAME_PLUS_CACHEKEY }}"
- name: Get CF deployment for NOITAVANIA_NEW_GAME_PLUS_CACHEKEY
id: get_cf_deployments_NOITAVANIA_NEW_GAME_PLUS
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.NOITAVANIA_NEW_GAME_PLUS_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for NOITAVANIA_NEW_GAME_PLUS_CACHEKEY
id: get_modified_on_NOITAVANIA_NEW_GAME_PLUS
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_NOITAVANIA_NEW_GAME_PLUS.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for NOITAVANIA_NEW_GAME_PLUS_CACHEKEY
id: gh_cachekey_update_NOITAVANIA_NEW_GAME_PLUS
run: |
PROJECT_CACHEKEY_VAR="NOITAVANIA_NEW_GAME_PLUS_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_NOITAVANIA_NEW_GAME_PLUS.outputs.modified_on }}\"}"
- name: PURGATORY_CACHEKEY
run: echo "current PURGATORY_CACHEKEY = ${{ env.PURGATORY_CACHEKEY }}"
- name: Get CF deployment for PURGATORY_CACHEKEY
id: get_cf_deployments_PURGATORY
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.PURGATORY_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for PURGATORY_CACHEKEY
id: get_modified_on_PURGATORY
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_PURGATORY.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for PURGATORY_CACHEKEY
id: gh_cachekey_update_PURGATORY
run: |
PROJECT_CACHEKEY_VAR="PURGATORY_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_PURGATORY.outputs.modified_on }}\"}"
- name: REGULAR_LEFT_PW_CACHEKEY
run: echo "current REGULAR_LEFT_PW_CACHEKEY = ${{ env.REGULAR_LEFT_PW_CACHEKEY }}"
- name: Get CF deployment for REGULAR_LEFT_PW_CACHEKEY
id: get_cf_deployments_REGULAR_LEFT_PW
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.REGULAR_LEFT_PW_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for REGULAR_LEFT_PW_CACHEKEY
id: get_modified_on_REGULAR_LEFT_PW
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_REGULAR_LEFT_PW.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for REGULAR_LEFT_PW_CACHEKEY
id: gh_cachekey_update_REGULAR_LEFT_PW
run: |
PROJECT_CACHEKEY_VAR="REGULAR_LEFT_PW_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_REGULAR_LEFT_PW.outputs.modified_on }}\"}"
- name: REGULAR_MAIN_BRANCH_CACHEKEY
run: echo "current REGULAR_MAIN_BRANCH_CACHEKEY = ${{ env.REGULAR_MAIN_BRANCH_CACHEKEY }}"
- name: Get CF deployment for REGULAR_MAIN_BRANCH_CACHEKEY
id: get_cf_deployments_REGULAR_MAIN_BRANCH
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.REGULAR_MAIN_BRANCH_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for REGULAR_MAIN_BRANCH_CACHEKEY
id: get_modified_on_REGULAR_MAIN_BRANCH
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_REGULAR_MAIN_BRANCH.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for REGULAR_MAIN_BRANCH_CACHEKEY
id: gh_cachekey_update_REGULAR_MAIN_BRANCH
run: |
PROJECT_CACHEKEY_VAR="REGULAR_MAIN_BRANCH_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_REGULAR_MAIN_BRANCH.outputs.modified_on }}\"}"
- name: REGULAR_MIDDLE_CACHEKEY
run: echo "current REGULAR_MIDDLE_CACHEKEY = ${{ env.REGULAR_MIDDLE_CACHEKEY }}"
- name: Get CF deployment for REGULAR_MIDDLE_CACHEKEY
id: get_cf_deployments_REGULAR_MIDDLE
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.REGULAR_MIDDLE_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for REGULAR_MIDDLE_CACHEKEY
id: get_modified_on_REGULAR_MIDDLE
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_REGULAR_MIDDLE.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for REGULAR_MIDDLE_CACHEKEY
id: gh_cachekey_update_REGULAR_MIDDLE
run: |
PROJECT_CACHEKEY_VAR="REGULAR_MIDDLE_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_REGULAR_MIDDLE.outputs.modified_on }}\"}"
- name: REGULAR_RIGHT_PW_CACHEKEY
run: echo "current REGULAR_RIGHT_PW_CACHEKEY = ${{ env.REGULAR_RIGHT_PW_CACHEKEY }}"
- name: Get CF deployment for REGULAR_RIGHT_PW_CACHEKEY
id: get_cf_deployments_REGULAR_RIGHT_PW
run: |
response=$(curl --request GET \
--header "Authorization: Bearer ${{ secrets.CF_PAGES_READ_ALL_API }}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/pages/projects/${{ vars.REGULAR_RIGHT_PW_CF_PROJECT_NAME }}/deployments")
echo "response_out: $response"
echo "=========="
echo "response_out=$(echo $response| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Get modified_on for REGULAR_RIGHT_PW_CACHEKEY
id: get_modified_on_REGULAR_RIGHT_PW
run: |
modified_on=$(jq -r '.result[0].modified_on' <<< '${{ steps.get_cf_deployments_REGULAR_RIGHT_PW.outputs.response_out }}' | date -u -f - +%s)
echo "modified_on is $modified_on"
echo "modified_on=${modified_on}" >> $GITHUB_OUTPUT
- name: Github Cachekey Update for REGULAR_RIGHT_PW_CACHEKEY
id: gh_cachekey_update_REGULAR_RIGHT_PW
run: |
PROJECT_CACHEKEY_VAR="REGULAR_RIGHT_PW_CACHEKEY"
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_NOITAMAP_VARS_ACCESS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/acidflow-noita/noitamap/actions/variables/${PROJECT_CACHEKEY_VAR}\
-d "{\"name\":\"${PROJECT_CACHEKEY_VAR}\",\"value\":\"${{ steps.get_modified_on_REGULAR_RIGHT_PW.outputs.modified_on }}\"}"
- name: Print all var names after change
run: |
echo "ALTERNATE_BIOMES_CACHEKEY is ${{ vars.ALTERNATE_BIOMES_CACHEKEY }}"
echo "APOTHEOSIS_CACHEKEY is ${{ vars.APOTHEOSIS_CACHEKEY }}"
echo "APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY is ${{ vars.APOTHEOSIS_NEW_GAME_PLUS_CACHEKEY }}"
echo "APOTHEOSIS_TUONELA_CACHEKEY is ${{ vars.APOTHEOSIS_TUONELA_CACHEKEY }}"
echo "NEW_GAME_PLUS_HD_CACHEKEY is ${{ vars.NEW_GAME_PLUS_HD_CACHEKEY }}"
echo "NIGHTMARE_HD_CACHEKEY is ${{ vars.NIGHTMARE_HD_CACHEKEY }}"
echo "NOITAVANIA_CACHEKEY is ${{ vars.NOITAVANIA_CACHEKEY }}"
echo "NOITAVANIA_NEW_GAME_PLUS_CACHEKEY is ${{ vars.NOITAVANIA_NEW_GAME_PLUS_CACHEKEY }}"
echo "PURGATORY_CACHEKEY is ${{ vars.PURGATORY_CACHEKEY }}"
echo "REGULAR_LEFT_PW_CACHEKEY is ${{ vars.REGULAR_LEFT_PW_CACHEKEY }}"
echo "REGULAR_MAIN_BRANCH_CACHEKEY is ${{ vars.REGULAR_MAIN_BRANCH_CACHEKEY }}"
echo "REGULAR_MIDDLE_CACHEKEY is ${{ vars.REGULAR_MIDDLE_CACHEKEY }}"
echo "REGULAR_RIGHT_PW_CACHEKEY is ${{ vars.REGULAR_RIGHT_PW_CACHEKEY }}"
- name: Print current directory
run: pwd
- name: List directory contents
run: ls -la
- name: Update index.html
run: |
perl -0777 -pi -e 's#<script id="cachekeys">.*?</script>#<script id="cachekeys">const tileCacheKeys = {\n"regular-middle.acidflow.stream": "${{ steps.get_modified_on_REGULAR_MIDDLE.outputs.modified_on }}",\n"regular-left-pw.acidflow.stream": "${{ steps.get_modified_on_REGULAR_LEFT_PW.outputs.modified_on }}",\n"regular-right-pw.acidflow.stream": "${{ steps.get_modified_on_REGULAR_RIGHT_PW.outputs.modified_on }}",\n"nightmare-hd.acidflow.stream": "${{ steps.get_modified_on_NIGHTMARE_HD.outputs.modified_on }}",\n"new-game-plus-hd.acidflow.stream": "${{ steps.get_modified_on_NEW_GAME_PLUS_HD.outputs.modified_on }}",\n"regular-main-branch.acidflow.stream": "${{ steps.get_modified_on_REGULAR_MAIN_BRANCH.outputs.modified_on }}",\n"purgatory.acidflow.stream": "${{ steps.get_modified_on_PURGATORY.outputs.modified_on }}",\n"apotheosis.acidflow.stream": "${{ steps.get_modified_on_APOTHEOSIS.outputs.modified_on }}",\n"apotheosis-new-game-plus.acidflow.stream": "${{ steps.get_modified_on_APOTHEOSIS_NEW_GAME_PLUS.outputs.modified_on }}",\n"noitavania.acidflow.stream": "${{ steps.get_modified_on_NOITAVANIA.outputs.modified_on }}",\n"noitavania-new-game-plus.acidflow.stream": "${{ steps.get_modified_on_NOITAVANIA_NEW_GAME_PLUS.outputs.modified_on }}",\n"alternate-biomes.acidflow.stream": "${{ steps.get_modified_on_ALTERNATE_BIOMES.outputs.modified_on }}",\n"apotheosis-tuonela.acidflow.stream": "${{ steps.get_modified_on_APOTHEOSIS_TUONELA.outputs.modified_on }}"\n};</script>#s' public/index.html
- name: Commit index.html changes
id: commit
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Actions"
git add public/index.html
if [ -z "$(git status --porcelain)" ]; then
echo "push=false" >> $GITHUB_OUTPUT
else
git commit -m "Update index.html"
echo "push=true" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Push changes
if: steps.commit.outputs.push == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_ACIDFRLOW_COMMIT_TO_REPO }}