-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (83 loc) · 2.33 KB
/
docs.yml
File metadata and controls
103 lines (83 loc) · 2.33 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
name: Deploy Docs & Demo
on:
pull_request:
branches: [ master, main ]
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'web/**'
- '.github/workflows/docs.yml'
push:
branches: [ main, master ]
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'web/**'
- '.github/workflows/docs.yml'
# Cancel an in-progress docs deploy when a newer push lands on main.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache node_modules
uses: actions/cache@v4
with:
path: web/node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('web/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
- name: Install MkDocs Material
run: pip install mkdocs-material
- name: Install web dependencies
run: npm ci
working-directory: web
- name: Typecheck web UI
run: npm run typecheck
working-directory: web
- name: Init MSW service worker
run: npx msw init public/ --save
working-directory: web
- name: Build demo site
run: npm run build:demo
working-directory: web
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
working-directory: web
- name: Take screenshots
run: npm run screenshots
working-directory: web
- name: Build MkDocs site
run: mkdocs build --strict
- name: Copy demo into docs site
run: rm -rf site/demo && cp -r web/dist-demo site/demo
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./site
deploy:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4