-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (81 loc) · 3.18 KB
/
docs.yml
File metadata and controls
93 lines (81 loc) · 3.18 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
# Docs workflow — builds VitePress documentation and deploys to GitHub Pages.
#
# IMPORTANT: GitHub Pages deploys the entire site as one atomic artifact.
# There is no way to deploy just a subdirectory. This means both this workflow
# and the Test workflow must assemble the COMPLETE site (docs + reports) to
# avoid overwriting each other. This workflow fetches existing reports from the
# live Pages site and includes them in the deployment artifact.
name: Docs
on:
push:
branches: [main]
paths:
- "docs/**"
- "package.json"
- "pnpm-lock.yaml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Build docs
run: pnpm docs:build
- name: Assemble GitHub Pages site
run: |
# Start with the VitePress build output as the site root
mkdir -p pages-root
cp -r docs/.vitepress/dist/* pages-root/
# Fetch existing reports from the live Pages site so we don't
# overwrite them. GitHub Pages is an atomic deployment — we must
# include everything in every deploy.
mkdir -p pages-root/reports/playwright pages-root/reports/allure
curl -fsSL "https://hal.github.io/dave/reports/playwright/index.html" \
-o pages-root/reports/playwright/index.html 2>/dev/null || true
curl -fsSL "https://hal.github.io/dave/reports/allure/index.html" \
-o pages-root/reports/allure/index.html 2>/dev/null || true
# Fetch the full Playwright report archive if available
cd pages-root/reports/playwright
curl -fsSL "https://hal.github.io/dave/reports/playwright/" \
| grep -oP 'href="\K[^"]+' \
| while read -r file; do
curl -fsSL "https://hal.github.io/dave/reports/playwright/$file" -o "$file" 2>/dev/null || true
done
cd -
# Fetch the full Allure report if available
cd pages-root/reports/allure
for f in index.html app.js styles.css history.jsonl; do
curl -fsSL "https://hal.github.io/dave/reports/allure/$f" -o "$f" 2>/dev/null || true
done
for dir in data export history plugins widgets; do
mkdir -p "$dir"
curl -fsSL "https://hal.github.io/dave/reports/allure/$dir/" \
| grep -oP 'href="\K[^"]+' \
| while read -r file; do
curl -fsSL "https://hal.github.io/dave/reports/allure/$dir/$file" -o "$dir/$file" 2>/dev/null || true
done
done
cd -
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: pages-root/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4