-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 1.12 KB
/
documentation.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
name: Docs
on: [push, pull_request, workflow_dispatch]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install sphinx==6.1.3 sphinx_rtd_theme sphinx-favicon myst_parser sphinx_sitemap
- name: Sphinx build
run: |
sphinx-build -W --keep-going doc _build
if [ $? -ne 0 ]; then
echo -e "\033[1;31mSphinx build FAILED\033[0m\n"
exit 1
else
echo -e "\033[1;32mSphinx build PASSED\033[0m\n"
fi
- name: Set branch name
id: branch
run: echo "SUBDIR_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Deploy
if: ${{ github.event_name != 'pull_request' }}
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
destination_dir: ${{ env.SUBDIR_NAME }}
full_commit_message: Deploy documentation of '${{ env.SUBDIR_NAME }}' to GitHub Pages