-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (54 loc) · 1.71 KB
/
docs_publish.yaml
File metadata and controls
57 lines (54 loc) · 1.71 KB
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
57
name: Publish Documentation
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install Dependencies
run: |
pip install --upgrade pip
pip install sphinx sphinx-rtd-theme myst-parser
#----------------------------------------------
# Build documentation
#----------------------------------------------
- name: Build documentation
run: sphinx-build -b html docs/source docs/build
#----------------------------------------------
# Clone documentation
#----------------------------------------------
- uses: actions/checkout@v3
with:
ref: gh-pages
path: pages
#----------------------------------------------
# Move documentation
#----------------------------------------------
- name: Move documentation
run: |
rm -r pages/docs/*
mv -f docs/build/* pages/docs/
#----------------------------------------------
# Commit & Push changes
#----------------------------------------------
- name: Commit and Push
continue-on-error: true
run: |
cd pages
git config user.name github-actions
git config user.email github-actions@github.com
git add -f docs/
git commit -m "Updated documentation"
git push