-
-
Notifications
You must be signed in to change notification settings - Fork 387
53 lines (43 loc) · 1.31 KB
/
docs.yml
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
name: Documentation Building
on:
release:
types: [published]
push:
branches:
- main
- v3.0
jobs:
docs:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: pdm-project/setup-pdm@v4
name: Set up PDM
with:
python-version: "3.12"
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
- name: Install dependencies
run: pdm sync -G:all
- name: Fetch gh pages
run: git fetch origin gh-pages --depth=1
- name: Build release docs
run: pdm run python tools/build_docs.py docs-build
if: github.event_name == 'release'
- name: Build docs (main branch)
run: pdm run python tools/build_docs.py docs-build --version main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- name: Build docs (v3.0 branch)
run: pdm run python tools/build_docs.py docs-build --version 3-dev
if: github.event_name == 'push' && github.ref == 'refs/heads/v3.0'
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs-build