-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (47 loc) · 1.32 KB
/
CI-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
54
55
56
---
name: CI-docs
# Build and deploy docs to gh-pages
on:
workflow_dispatch:
pull_request:
branches: [main]
types: [opened, closed, synchronize]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Python dependencies
run: |
pip install '.[doc]'
- name: Check for non-ASCII characters
run: |
output=$(perl -ne 'print if /[^[:ascii:]]/' docs/source/*)
if [ -n "$output" ]; then
echo "Non-ASCII characters found in documentation."
exit 1
fi
- name: Build docs
shell: bash -l {0}
run: |
make -C docs/ html
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Make command failed with exit code $exit_code"
exit $exit_code
fi
touch docs/build/html/.nojekyll
- name: Deploy to github pages
# only run when PR is merged
if: github.event.pull_request.merged
uses: JamesIves/github-pages-deploy-action@v4
with:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/build/html
CLEAN: true