Merge pull request #92 from elseml/Development #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From https://github.com/eeholmes/readthedoc-test/blob/main/.github/workflows/docs_pages.yml | |
name: docs | |
# execute this workflow automatically when a we push to master | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build_docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v3 | |
with: | |
path: master | |
- name: Checkout gh-pages | |
uses: actions/checkout@v3 | |
with: | |
path: gh-pages | |
ref: gh-pages | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
cd ./master | |
python -m pip install .[docs] | |
- name: Make the Sphinx docs | |
run: | | |
cd ./master/docsrc | |
make clean | |
make github | |
- name: Commit changes to docs | |
run: | | |
cd ./gh-pages | |
cp -R ../master/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 |