-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (33 loc) · 904 Bytes
/
docs.yaml
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
name: Build docs
on:
push:
branches:
- "*"
jobs:
sphinx_docs_to_gh-pages:
name: Sphinx docs to gh-pages
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.12"
cache: true
- name: Install dependencies
run: pdm sync
- name: Build docs
run: pdm docs
- name: Create .nojekyll in case 'sphinx.ext.githubpages' is not used
run: touch "docs/_build/.nojekyll"
- name: Push to gh-pages
run: |
git add -f "docs/_build/"
git commit -m "From $GITHUB_REF"
git push origin `git subtree split --prefix "docs/_build/" "$GITHUB_REF"`:gh-pages --force