-
Notifications
You must be signed in to change notification settings - Fork 21
51 lines (42 loc) · 1.43 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
44
45
46
47
48
49
50
51
# this workflow sets up dependencies, builds the documentation, and updates the gh-pages branch
# the gh-pages branch is what's used for GitHub Pages
name: Documentation
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
push:
branches:
- update-documentation
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx==7.2.6
pip install myst-parser==2.0.0
pip install sphinx_rtd_theme==2.0.0
pip install pandas
pip install argparse
- name: Set variables for public github repo
run: |
echo "BASE_URL=https://github.com/NREL/ReEDS-2.0" >> $GITHUB_ENV
python docs/source/documentation_tools/generate_markdown.py --githubURL "https://github.com/NREL/ReEDS-2.0/blob/main" --reedsPath "${GITHUB_WORKSPACE}"
- name: Build Sphinx documentation
run: sphinx-build docs/source docs/build/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build