-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (39 loc) · 1.24 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-sphinx-docs
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- 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
- name: Deploy to GitHub Pages
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git checkout gh-pages || git checkout --orphan gh-pages
git pull origin gh-pages || true
rm -rf *
mv -f ./${{ github.workspace }}/docs/_build/html/* .
touch .nojekyll
git add .
git commit -m "Deploy documentation from GitHub Actions"
git push origin gh-pages