-
Notifications
You must be signed in to change notification settings - Fork 5
104 lines (89 loc) · 2.66 KB
/
Copy pathdocs.yml
File metadata and controls
104 lines (89 loc) · 2.66 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
name: Documentation
on:
push:
branches:
- master
paths:
- 'docs/**'
- 'mkdocs.yml'
- '.github/workflows/docs.yml'
pull_request:
paths:
- 'docs/**'
- 'mkdocs.yml'
- '.github/workflows/docs.yml'
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: pip install "mkdocs-material>=9,<10" "mkdocs<2.0"
- name: Setup Pages
if: github.event_name != 'pull_request'
uses: actions/configure-pages@v4
- name: Build documentation
run: mkdocs build --strict
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site/
# Generate screenshots for PR preview
- name: Install Playwright
if: github.event_name == 'pull_request'
run: npx playwright install --with-deps chromium
- name: Capture screenshots
if: github.event_name == 'pull_request'
run: |
# Start local server in background
python -m http.server 8000 -d site &
SERVER_PID=$!
sleep 2
mkdir -p screenshots
# Capture each page
for page in \
"index.html:01-home" \
"getting-started/index.html:02-getting-started" \
"interface-overview/index.html:03-interface-overview" \
"ica-tab-guide/index.html:04-ica-tab-guide" \
"classification-workflow/index.html:05-classification-workflow" \
"qc-tab-guide/index.html:06-qc-tab-guide" \
"troubleshooting/index.html:07-troubleshooting"
do
URL_PATH="${page%%:*}"
NAME="${page##*:}"
npx playwright screenshot \
--viewport-size="1280,720" \
--full-page \
"http://localhost:8000/${URL_PATH}" \
"screenshots/${NAME}.png"
done
kill $SERVER_PID
- name: Upload screenshots
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: docs-screenshots
path: screenshots/
deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-22.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4