Repository navigation
58 lines (49 loc) · 1.47 KB
/
Copy pathdocs.yml
File metadata and controls
58 lines (49 loc) · 1.47 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
name: Docs
on:
push:
branches: [main]
paths:
- "docs/**"
- "assets/**"
- "website/**"
- ".github/workflows/docs.yml"
# every pull request builds the site (deploying stays main-only, below)
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install MkDocs
run: pip install mkdocs-material==9.7.7
# The site config lives in website/; docs/ and assets/ stay at the repo
# root. website/hooks/copy_assets.py pulls the media into the build, so
# figures and audio are handled here exactly as they are under `serve`.
- name: Build site
run: mkdocs build -f website/mkdocs.yml --strict
- name: Check every image and audio reference resolves
run: python website/scripts/check_site_assets.py
- uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
# Only publish from main; pull requests just build and check.
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4