Repository navigation
76 lines (65 loc) · 1.83 KB
/
Copy pathdocs.yml
File metadata and controls
76 lines (65 loc) · 1.83 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
name: Documentation
on:
push:
branches: [ main ]
pull_request:
paths:
- .github/workflows/docs.yml
- CHANGELOG.md
- README.md
- UPGRADE-2.0.md
- doc/**
- tools/zensical/**
- zensical.toml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
# Let a deployment finish: the next one waits.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
name: Build the Documentation
runs-on: ubuntu-24.04
steps:
- name: Checkout Code
uses: actions/checkout@v7
with:
# The site is published: keep the token out of the workspace.
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: '3.14'
cache: pip
cache-dependency-path: tools/zensical/requirements.txt
- name: Install Zensical
run: pip install -r tools/zensical/requirements.txt
- name: Write the pages
run: python tools/zensical/pages.py
# Strict, as configured in zensical.toml: a broken link or anchor fails.
- name: Build the site
run: zensical build --clean
- name: Upload the site
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v5
with:
path: site
deploy:
name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-24.04
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v6
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5