forked from bayesflow-org/bayesflow
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.47 KB
/
docs.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# From https://github.com/eeholmes/readthedoc-test/blob/main/.github/workflows/docs_pages.yml
name: docs
# execute this workflow automatically when we push to master or dev
on:
push:
branches:
- master
- dev
jobs:
build_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v3
with:
path: dev
fetch-depth: 0
fetch-tags: true
- name: Checkout gh-pages-dev
uses: actions/checkout@v3
with:
path: gh-pages-dev
ref: gh-pages-dev
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "pip"
- name: Install dependencies
run: |
cd ./dev
python -m pip install .[docs]
- name: Create local branches
run: |
cd ./dev
git branch master remotes/origin/master
- name: Make the Sphinx docs
run: |
cd ./dev/docsrc
make clean
make github
- name: Commit changes to docs
run: |
cd ./gh-pages-dev
cp -R ../dev/docs/* ./
git config --local user.email ""
git config --local user.name "github-actions"
git add -A
if ! git diff-index --quiet HEAD; then
git commit -m "auto: Rebuild docs."
git push
else
echo No commit made because the docs have not changed.
fi