-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (79 loc) · 2.81 KB
/
Copy pathdeploy-website.yml
File metadata and controls
91 lines (79 loc) · 2.81 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
name: Deploy Website
# Deploy the static documentation site to GitHub Pages.
# Screenshots are generated by the Frontend E2E Tests workflow and downloaded
# here as an artifact, so the guide always shows the current UI without
# duplicating the docker-compose sandbox setup.
#
# Chain position:
# CI → Sandbox Masking Verification → Frontend E2E Tests → [this workflow]
on:
workflow_run:
workflows: ["Frontend E2E Tests"]
branches: [main]
types: [completed]
workflow_dispatch:
inputs:
e2e_run_id:
description: 'Frontend E2E workflow run ID to download screenshots from (leave blank to skip screenshots)'
required: false
default: ''
type: string
permissions:
contents: read
pages: write
id-token: write
# Only one Pages deployment runs at a time; skip intermediate queued runs.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
name: Build Website
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4
# Download the ui-screenshots artifact produced by the Frontend E2E Tests workflow.
# On workflow_run, use the triggering run's ID. On workflow_dispatch, use the
# optional e2e_run_id input (or skip gracefully if not provided).
- name: Resolve E2E run ID
id: run-id
run: |
if [ "${{ github.event_name }}" = "workflow_run" ]; then
echo "run_id=${{ github.event.workflow_run.id }}" >> "$GITHUB_OUTPUT"
elif [ -n "${{ github.event.inputs.e2e_run_id }}" ]; then
echo "run_id=${{ github.event.inputs.e2e_run_id }}" >> "$GITHUB_OUTPUT"
else
echo "run_id=" >> "$GITHUB_OUTPUT"
fi
- name: Download screenshots from E2E run
if: steps.run-id.outputs.run_id != ''
uses: actions/download-artifact@v4
with:
name: ui-screenshots
path: docs/website/screenshots/
run-id: ${{ steps.run-id.outputs.run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: List screenshots
run: |
echo "Screenshots in docs/website/screenshots/:"
ls -la docs/website/screenshots/ || echo "(directory not found or empty)"
- name: Configure Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/website
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4