-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (37 loc) · 1.12 KB
/
build-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
name: Build and deploy sphinx docs
on:
push:
branches: main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Build documentation
run: |
cd docs/
make html
- uses: actions/checkout@v4
with:
ref: "gh-pages"
repository: ${{ github.repository }}
path: "gh-pages-docs"
- name: Deploy to GitHub Pages
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
rm -rf ./gh-pages-docs/*
mv -f ${{ github.workspace }}/docs/_build/html/* ./gh-pages-docs
cd ./gh-pages-docs
touch .nojekyll
git add .
git commit -m "Deploy documentation from GitHub Actions" --allow-empty
git push origin gh-pages