Repository navigation
512 lines (488 loc) · 22.2 KB
/
Copy pathpullpreview-env.yml
File metadata and controls
512 lines (488 loc) · 22.2 KB
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
499
500
501
502
503
504
505
506
507
508
509
510
511
512
name: PullPreview Environment
run-name: >-
${{
format(
'PullPreview env · {0}{1} · {2} · {3} · {4} · {5} · {6} · {7}',
github.event.inputs.openproject_standalone == 'true' && 'standalone ' || '',
github.event.inputs.setup_method,
format(
'OP {0}{1}',
github.event.inputs.openproject_version != '' && github.event.inputs.openproject_version || '18.0-rc-slim',
github.event.inputs.openproject_branch != '' && format(' ({0})', github.event.inputs.openproject_branch) || ''
),
github.event.inputs.openproject_standalone == 'true'
&& 'NC off'
|| format(
'NC {0}{1}',
github.event.inputs.nextcloud_version != '' && github.event.inputs.nextcloud_version || '35',
github.event.inputs.nextcloud_branch != '' && format(' ({0})', github.event.inputs.nextcloud_branch) || ''
),
github.event.inputs.openproject_standalone == 'true'
&& 'app n/a'
|| (github.event.inputs.integration_app_branch != '' && format('app ({0})', github.event.inputs.integration_app_branch) || (github.event.inputs.integration_app_version != '' && format('app {0}', github.event.inputs.integration_app_version) || 'app default')),
github.event.inputs.xwiki_enabled == 'true'
&& format(
'XWiki {0} + ext {1}',
github.event.inputs.xwiki_version != '' && github.event.inputs.xwiki_version || '17.10.15',
github.event.inputs.xwiki_extension_version != '' && github.event.inputs.xwiki_extension_version || '1.2.0'
)
|| 'XWiki off',
github.event.inputs.gitlab_enabled == 'true'
&& format(
'GitLab {0}',
github.event.inputs.gitlab_version != '' && github.event.inputs.gitlab_version || 'v19.4.1'
)
|| 'GitLab off',
github.event.inputs.squashtm_enabled == 'true'
&& format(
'SquashTM {0}',
github.event.inputs.squashtm_version != '' && github.event.inputs.squashtm_version || '15.0.3'
)
|| 'SquashTM off'
)
}}
defaults:
run:
shell: bash
on:
workflow_dispatch:
inputs:
setup_method:
description: "[Stack] Integration setup mode"
required: true
default: sso-external
type: choice
options:
- sso-external
- sso-nextcloud
- oauth2
openproject_standalone:
description: "[Stack] OpenProject standalone (no Nextcloud; Keycloak only with sso-external)"
required: false
default: false
type: boolean
enterprise_token_tier:
description: "[Stack] OpenProject enterprise plan (integration stack requires corporate)"
required: true
default: corporate
type: choice
options:
- corporate
openproject_version:
description: "[OpenProject] Image tag (empty = 18.0-rc-slim)"
required: false
type: string
openproject_branch:
description: "[OpenProject] Optional git source branch"
required: false
type: string
openproject_wiki_enhancements:
description: "[OpenProject] Enable wiki_enhancements feature flag (XWiki)"
required: false
default: true
type: boolean
nextcloud_version:
description: "[Nextcloud] Image tag (empty = 35; ignored when standalone)"
required: false
type: string
nextcloud_branch:
description: "[Nextcloud] Optional git source branch (ignored when standalone)"
required: false
type: string
integration_app_version:
description: "[Integration app] Version (empty = 3.3.0; ignored when standalone)"
required: false
type: string
integration_app_branch:
description: "[Integration app] Git branch override (ignored when standalone)"
required: false
type: string
xwiki_enabled:
description: "[XWiki] Deploy XWiki (versions below ignored when unchecked)"
required: false
default: false
type: boolean
xwiki_version:
description: "[XWiki] Image tag (used only when XWiki is checked)"
required: false
default: "17.10.15"
type: string
xwiki_extension_version:
description: "[XWiki] OpenProject extension version (used only when XWiki is checked)"
required: false
default: "1.2.0"
type: string
gitlab_enabled:
description: "[GitLab] Deploy GitLab (version below ignored when unchecked)"
required: false
default: false
type: boolean
gitlab_version:
description: "[GitLab] Image tag (used only when GitLab is checked)"
required: false
default: "v19.4.1"
type: string
squashtm_enabled:
description: "[Squash TM] Deploy Squash TM (version below ignored when unchecked)"
required: false
default: false
type: boolean
squashtm_version:
description: "[Squash TM] Image tag (used only when Squash TM is checked)"
required: false
default: "15.0.3"
type: string
permissions:
contents: read
actions: read
jobs:
resolve_deploy_inputs:
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
openproject_version: ${{ steps.validate.outputs.openproject_version }}
openproject_branch: ${{ steps.validate.outputs.openproject_branch }}
nextcloud_version: ${{ steps.validate.outputs.nextcloud_version }}
nextcloud_branch: ${{ steps.validate.outputs.nextcloud_branch }}
integration_openproject_version: ${{ steps.validate.outputs.integration_openproject_version }}
integration_openproject_branch: ${{ steps.validate.outputs.integration_openproject_branch }}
effective_xwiki_version: ${{ steps.validate.outputs.effective_xwiki_version }}
effective_xwiki_extension_version: ${{ steps.validate.outputs.effective_xwiki_extension_version }}
effective_gitlab_version: ${{ steps.validate.outputs.effective_gitlab_version }}
effective_squashtm_version: ${{ steps.validate.outputs.effective_squashtm_version }}
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Validate stack topology
env:
IN_SETUP: ${{ github.event.inputs.setup_method }}
IN_STANDALONE: ${{ github.event.inputs.openproject_standalone }}
IN_XWIKI_ENABLED: ${{ github.event.inputs.xwiki_enabled }}
IN_GITLAB_ENABLED: ${{ github.event.inputs.gitlab_enabled }}
IN_SQUASHTM_ENABLED: ${{ github.event.inputs.squashtm_enabled }}
run: .github/scripts/resolve-stack-topology.sh "" "${IN_SETUP}" >/dev/null
- name: Validate and resolve deploy inputs
id: validate
env:
IN_OP_VER: ${{ github.event.inputs.openproject_version }}
IN_NC_VER: ${{ github.event.inputs.nextcloud_version }}
IN_XWIKI_ENABLED: ${{ github.event.inputs.xwiki_enabled }}
IN_XWIKI_VER: ${{ github.event.inputs.xwiki_version }}
IN_IO_VER: ${{ github.event.inputs.integration_app_version }}
IN_XWIKI_EXT: ${{ github.event.inputs.xwiki_extension_version }}
IN_GITLAB_ENABLED: ${{ github.event.inputs.gitlab_enabled }}
IN_GITLAB_VER: ${{ github.event.inputs.gitlab_version }}
IN_SQUASHTM_ENABLED: ${{ github.event.inputs.squashtm_enabled }}
IN_SQUASHTM_VER: ${{ github.event.inputs.squashtm_version }}
IN_OP_BRANCH: ${{ github.event.inputs.openproject_branch }}
IN_NC_BRANCH: ${{ github.event.inputs.nextcloud_branch }}
IN_IO_BRANCH: ${{ github.event.inputs.integration_app_branch }}
IN_NEXTCLOUD_ENABLED: ${{ github.event.inputs.openproject_standalone != 'true' && 'true' || 'false' }}
run: .github/scripts/validate-deploy-inputs.sh
deploy:
needs: [resolve_deploy_inputs]
runs-on: ubuntu-latest
timeout-minutes: 120
env:
CI: true
HEADLESS: true
SKIP_SETUP_JOB_CHECK: true
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
HETZNER_CA_KEY: ${{ secrets.HETZNER_CA_KEY }}
outputs:
live: ${{ steps.publish.outputs.live }}
preview_name: ${{ steps.publish.outputs.preview_name }}
openproject_host: ${{ steps.publish.outputs.openproject_host }}
openproject_url: ${{ steps.publish.outputs.openproject_url }}
nextcloud_host: ${{ steps.publish.outputs.nextcloud_host }}
keycloak_host: ${{ steps.publish.outputs.keycloak_host }}
xwiki_host: ${{ steps.publish.outputs.xwiki_host }}
gitlab_host: ${{ steps.publish.outputs.gitlab_host }}
squashtm_host: ${{ steps.publish.outputs.squashtm_host }}
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Resolve enterprise token
id: enterprise_token
env:
ENTERPRISE_TOKEN_TIER: ${{ github.event.inputs.enterprise_token_tier }}
TOKEN_CORPORATE: ${{ secrets.OPENPROJECT_ENTERPRISE_TOKEN }}
run: .github/scripts/resolve-enterprise-token.sh
- name: Record run start time (Europe/Berlin)
env:
IN_TIER: ${{ github.event.inputs.enterprise_token_tier }}
run: |
set -euo pipefail
ts="$(TZ=Europe/Berlin date '+%d %b %Y %H:%M:%S')"
{
echo "### PullPreview Environment"
echo ""
echo "**Started (Europe/Berlin):** ${ts}"
echo "**Enterprise token tier:** ${IN_TIER:-corporate}"
echo ""
} >> "${GITHUB_STEP_SUMMARY}"
echo "::notice::PullPreview Environment deploy started (Europe/Berlin): ${ts}"
- name: Resolve topology and preview name
id: resolve
env:
IN_SETUP: ${{ github.event.inputs.setup_method }}
IN_STANDALONE: ${{ github.event.inputs.openproject_standalone }}
IN_XWIKI_ENABLED: ${{ github.event.inputs.xwiki_enabled }}
IN_GITLAB_ENABLED: ${{ github.event.inputs.gitlab_enabled }}
IN_SQUASHTM_ENABLED: ${{ github.event.inputs.squashtm_enabled }}
RUN_ID: ${{ github.run_id }}
RUN_ATTEMPT: ${{ github.run_attempt }}
SECRET_HCLOUD: ${{ secrets.HCLOUD_TOKEN }}
SECRET_HETZNER_CA: ${{ secrets.HETZNER_CA_KEY }}
SECRET_SQUASHTM_ADMIN_PASSWORD: ${{ secrets.SQUASHTM_ADMIN_PASSWORD }}
PULLPREVIEW_ADMIN_PASSWORD: ${{ secrets.PULLPREVIEW_ADMIN_PASSWORD }}
PULLPREVIEW_USER_PASSWORD: ${{ secrets.PULLPREVIEW_USER_PASSWORD }}
PULLPREVIEW_MCP_TOKEN: ${{ secrets.PULLPREVIEW_MCP_TOKEN }}
run: |
set -euo pipefail
if [[ -z "${SECRET_HCLOUD:-}" ]]; then
echo "::error::Secret HCLOUD_TOKEN is not set or empty."
exit 1
fi
if [[ -z "${SECRET_HETZNER_CA:-}" ]]; then
echo "::error::Secret HETZNER_CA_KEY is not set or empty."
exit 1
fi
.github/scripts/require-preview-secrets.sh
if [[ "${IN_SQUASHTM_ENABLED:-false}" == "true" && -z "${SECRET_SQUASHTM_ADMIN_PASSWORD:-}" ]]; then
echo "::error::Secret SQUASHTM_ADMIN_PASSWORD is required when Squash TM is enabled."
exit 1
fi
preview_name="env-${RUN_ID}-${RUN_ATTEMPT}"
{
.github/scripts/resolve-stack-topology.sh "" "${IN_SETUP}"
echo "preview_name=${preview_name}"
} >> "$GITHUB_OUTPUT"
- name: PullPreview up
id: pullpreview_up
if: success()
uses: ./.github/actions/pullpreview # vendored from pullpreview/action@65df5209 (POC #133) + actions/cache@v6 Node 24
with:
provider: hetzner
label: ${{ steps.resolve.outputs.preview_name }}
force_action: up
region: fsn1
image: ubuntu-24.04
instance_type: cpx42
dns: my.opf.run
max_domain_length: "40"
deployment_target: helm
chart: ./charts/pullpreview-stack
chart_values: pullpreview/stack-values.yaml.gotmpl
pre_script: pullpreview/pre-script-helm-deps-e2e.sh
proxy_tls: traefik:80
proxy_tls_hosts: ${{ steps.resolve.outputs.proxy_tls_hosts }}
ttl: 72h
env:
PULLPREVIEW_LOGGER_LEVEL: INFO
OPENPROJECT_ENTERPRISE_TOKEN: ${{ steps.enterprise_token.outputs.token }}
INTEGRATION_SETUP_METHOD: ${{ github.event.inputs.setup_method }}
OPENPROJECT_VERSION: ${{ github.event.inputs.openproject_version }}
OPENPROJECT_BRANCH: ${{ github.event.inputs.openproject_branch }}
NEXTCLOUD_VERSION: ${{ github.event.inputs.nextcloud_version }}
NEXTCLOUD_BRANCH: ${{ github.event.inputs.nextcloud_branch }}
INTEGRATION_OPENPROJECT_VERSION: ${{ needs.resolve_deploy_inputs.outputs.integration_openproject_version }}
INTEGRATION_OPENPROJECT_GIT_BRANCH: ${{ needs.resolve_deploy_inputs.outputs.integration_openproject_branch }}
XWIKI_VERSION: ${{ needs.resolve_deploy_inputs.outputs.effective_xwiki_version }}
XWIKI_EXTENSION_OPENPROJECT_VERSION: ${{ needs.resolve_deploy_inputs.outputs.effective_xwiki_extension_version }}
OPENPROJECT_FEATURE_WIKI_ENHANCEMENTS: ${{ github.event.inputs.openproject_wiki_enhancements }}
XWIKI_ENABLED: ${{ steps.resolve.outputs.xwiki_enabled }}
GITLAB_ENABLED: ${{ steps.resolve.outputs.gitlab_enabled }}
GITLAB_VERSION: ${{ needs.resolve_deploy_inputs.outputs.effective_gitlab_version }}
SQUASHTM_ENABLED: ${{ steps.resolve.outputs.squashtm_enabled }}
SQUASHTM_VERSION: ${{ needs.resolve_deploy_inputs.outputs.effective_squashtm_version }}
SQUASHTM_ADMIN_PASSWORD: ${{ secrets.SQUASHTM_ADMIN_PASSWORD }}
PULLPREVIEW_ADMIN_PASSWORD: ${{ secrets.PULLPREVIEW_ADMIN_PASSWORD }}
PULLPREVIEW_USER_PASSWORD: ${{ secrets.PULLPREVIEW_USER_PASSWORD }}
PULLPREVIEW_MCP_TOKEN: ${{ secrets.PULLPREVIEW_MCP_TOKEN }}
STACK_PROFILE: ${{ steps.resolve.outputs.stack_profile }}
- name: Deploy preview summary
if: always() && steps.pullpreview_up.outcome != 'skipped'
env:
PREVIEW_NAME: ${{ steps.resolve.outputs.preview_name }}
PULLPREVIEW_OUTCOME: ${{ steps.pullpreview_up.outcome }}
PULLPREVIEW_LIVE: ${{ steps.pullpreview_up.outputs.live }}
PREVIEW_URL: ${{ steps.pullpreview_up.outputs.url }}
SKIP_NEXTCLOUD: ${{ steps.resolve.outputs.skip_nextcloud }}
SKIP_XWIKI: ${{ steps.resolve.outputs.skip_xwiki }}
SKIP_KEYCLOAK: ${{ steps.resolve.outputs.skip_keycloak }}
SKIP_GITLAB: ${{ steps.resolve.outputs.skip_gitlab }}
SKIP_SQUASHTM: ${{ steps.resolve.outputs.skip_squashtm }}
run: .github/scripts/deploy-preview-summary.sh
- name: Report Let's Encrypt rate limit
if: always() && steps.pullpreview_up.outcome != 'skipped'
env:
GH_TOKEN: ${{ github.token }}
run: .github/scripts/report-letsencrypt-rate-limit.sh
- name: Preview endpoint checks
id: validate_urls
uses: ./.github/actions/preview-endpoint-checks
if: success() && steps.pullpreview_up.outputs.live == 'true'
continue-on-error: true
with:
preview-url: ${{ steps.pullpreview_up.outputs.url }}
skip-xwiki: ${{ steps.resolve.outputs.skip_xwiki }}
skip-nextcloud: ${{ steps.resolve.outputs.skip_nextcloud }}
skip-keycloak: ${{ steps.resolve.outputs.skip_keycloak }}
skip-gitlab: ${{ steps.resolve.outputs.skip_gitlab }}
skip-squashtm: ${{ steps.resolve.outputs.skip_squashtm }}
- name: Export hosts
id: export_hosts
if: always() && steps.pullpreview_up.outputs.live == 'true'
env:
PREVIEW_URL: ${{ steps.pullpreview_up.outputs.url }}
PREVIEW_NAME: ${{ steps.resolve.outputs.preview_name }}
SKIP_NEXTCLOUD: ${{ steps.resolve.outputs.skip_nextcloud }}
SKIP_XWIKI: ${{ steps.resolve.outputs.skip_xwiki }}
SKIP_KEYCLOAK: ${{ steps.resolve.outputs.skip_keycloak }}
SKIP_GITLAB: ${{ steps.resolve.outputs.skip_gitlab }}
SKIP_SQUASHTM: ${{ steps.resolve.outputs.skip_squashtm }}
run: |
set -euo pipefail
preview_url="${PREVIEW_URL}"
preview_host="$(.github/scripts/preview-parse-host.sh)"
if [[ "${preview_url}" == *:443 ]]; then
preview_url="${preview_url%:443}"
fi
{
echo "OPENPROJECT_HOST=${preview_host}"
echo "OPENPROJECT_URL=${preview_url}"
} >> "$GITHUB_ENV"
if [[ "${SKIP_NEXTCLOUD:-false}" != "true" ]]; then
echo "NEXTCLOUD_HOST=nextcloud.${preview_host}" >> "$GITHUB_ENV"
fi
if [[ "${SKIP_KEYCLOAK:-false}" != "true" ]]; then
echo "KEYCLOAK_HOST=keycloak.${preview_host}" >> "$GITHUB_ENV"
fi
if [[ "${SKIP_XWIKI:-false}" != "true" ]]; then
echo "XWIKI_HOST=xwiki.${preview_host}" >> "$GITHUB_ENV"
fi
if [[ "${SKIP_GITLAB:-false}" != "true" ]]; then
echo "GITLAB_HOST=gitlab.${preview_host}" >> "$GITHUB_ENV"
fi
if [[ "${SKIP_SQUASHTM:-false}" != "true" ]]; then
echo "SQUASHTM_HOST=squashtm.${preview_host}" >> "$GITHUB_ENV"
fi
{
echo "### PullPreview endpoints"
echo ""
echo "- Preview name: \`${PREVIEW_NAME}\`"
echo "- OpenProject: ${preview_url}"
if [[ "${SKIP_NEXTCLOUD:-false}" != "true" ]]; then
echo "- Nextcloud: https://nextcloud.${preview_host}"
fi
if [[ "${SKIP_KEYCLOAK:-false}" != "true" ]]; then
echo "- Keycloak: https://keycloak.${preview_host}"
fi
if [[ "${SKIP_XWIKI:-false}" != "true" ]]; then
echo "- XWiki: https://xwiki.${preview_host}"
fi
if [[ "${SKIP_GITLAB:-false}" != "true" ]]; then
echo "- GitLab: https://gitlab.${preview_host}"
fi
if [[ "${SKIP_SQUASHTM:-false}" != "true" ]]; then
echo "- Squash TM: https://squashtm.${preview_host}/squash"
fi
} >> "$GITHUB_STEP_SUMMARY"
- name: Publish deploy outputs
id: publish
if: always()
env:
LIVE: ${{ steps.pullpreview_up.outputs.live }}
PREVIEW_NAME: ${{ steps.resolve.outputs.preview_name }}
run: |
set -euo pipefail
{
echo "live=${LIVE:-}"
echo "preview_name=${PREVIEW_NAME}"
echo "openproject_host=${OPENPROJECT_HOST:-}"
echo "openproject_url=${OPENPROJECT_URL:-}"
echo "nextcloud_host=${NEXTCLOUD_HOST:-}"
echo "keycloak_host=${KEYCLOAK_HOST:-}"
echo "xwiki_host=${XWIKI_HOST:-}"
echo "gitlab_host=${GITLAB_HOST:-}"
echo "squashtm_host=${SQUASHTM_HOST:-}"
} >> "$GITHUB_OUTPUT"
- name: Environment kept notice
if: >-
always() &&
steps.publish.outputs.live == 'true' &&
steps.publish.outputs.preview_name != ''
env:
PREVIEW_NAME: ${{ steps.publish.outputs.preview_name }}
OPENPROJECT_URL: ${{ steps.publish.outputs.openproject_url }}
NEXTCLOUD_HOST: ${{ steps.publish.outputs.nextcloud_host }}
KEYCLOAK_HOST: ${{ steps.publish.outputs.keycloak_host }}
XWIKI_HOST: ${{ steps.publish.outputs.xwiki_host }}
GITLAB_HOST: ${{ steps.publish.outputs.gitlab_host }}
SQUASHTM_HOST: ${{ steps.publish.outputs.squashtm_host }}
run: |
set -euo pipefail
{
echo "### PullPreview environment kept"
echo ""
echo "Deploy-only environment (no E2E / MCP tests). TTL 72h."
echo ""
echo "- Preview label: \`${PREVIEW_NAME}\`"
if [[ -n "${OPENPROJECT_URL}" ]]; then
echo "- OpenProject: ${OPENPROJECT_URL}"
fi
if [[ -n "${NEXTCLOUD_HOST}" ]]; then
echo "- Nextcloud: https://${NEXTCLOUD_HOST}"
fi
if [[ -n "${KEYCLOAK_HOST}" ]]; then
echo "- Keycloak: https://${KEYCLOAK_HOST}"
fi
if [[ -n "${XWIKI_HOST}" ]]; then
echo "- XWiki: https://${XWIKI_HOST}"
fi
if [[ -n "${GITLAB_HOST}" ]]; then
echo "- GitLab: https://${GITLAB_HOST}"
fi
if [[ -n "${SQUASHTM_HOST}" ]]; then
echo "- Squash TM: https://${SQUASHTM_HOST}/squash"
fi
echo ""
echo "To tear down later, run workflow **PullPreview Cleanup**:"
echo "- \`target=env\`"
echo "- \`mode=teardown\`"
echo "- \`confirm_teardown=true\`"
echo "- Preview label: \`${PREVIEW_NAME}\`"
echo ""
} >> "${GITHUB_STEP_SUMMARY}"
echo "::notice::PullPreview Environment is live. Tear down via **PullPreview Cleanup** (target=env)."
- name: Tear down failed preview
if: >-
always() &&
steps.publish.outputs.preview_name != '' &&
steps.publish.outputs.live != 'true'
uses: ./.github/actions/pullpreview # vendored from pullpreview/action@65df5209 (POC #133) + actions/cache@v6 Node 24
with:
provider: hetzner
label: ${{ steps.publish.outputs.preview_name }}
force_action: down
deployment_target: helm
env:
PULLPREVIEW_LOGGER_LEVEL: ERROR
- name: Final status
if: always()
env:
LIVE: ${{ steps.publish.outputs.live }}
PREVIEW_NAME: ${{ steps.publish.outputs.preview_name }}
VALIDATE_OUTCOME: ${{ steps.validate_urls.outcome }}
run: |
set -euo pipefail
if [[ "${LIVE}" == "true" ]]; then
if [[ "${VALIDATE_OUTCOME}" != "success" ]]; then
echo "::warning::Preview is live but endpoint checks did not pass (${VALIDATE_OUTCOME:-skipped}); some services may still be starting."
fi
echo "::notice::PullPreview Environment is live (${PREVIEW_NAME}). Tear down via **PullPreview Cleanup** (target=env)."
exit 0
fi
echo "::error::PullPreview Environment did not become live. See deploy logs."
exit 1