| 1 |
name: Publish Docs |
| 2 |
on: |
| 3 |
page_build: |
| 4 |
branches: |
| 5 |
- gh-pages |
| 6 |
paths-ignore: |
| 7 |
- 'docs/**' |
| 8 |
workflow_run: |
| 9 |
workflows: [update-doxygen] |
| 10 |
types: |
| 11 |
- completed |
| 12 |
jobs: |
| 13 |
build_and_publish: |
| 14 |
runs-on: ubuntu-latest |
| 15 |
steps: |
| 16 |
- uses: actions/checkout@v2 |
| 17 |
- name: Set up Python |
| 18 |
uses: actions/setup-python@v2 |
| 19 |
with: |
| 20 |
python-version: 3.8 |
| 21 |
- name: Checkout gh-pages |
| 22 |
run: | |
| 23 |
git fetch origin gh-pages |
| 24 |
git checkout gh-pages |
| 25 |
- name: Install dependencies |
| 26 |
run: | |
| 27 |
python -m pip install --upgrade pip |
| 28 |
pip install -r requirements.txt |
| 29 |
- name: Generate html |
| 30 |
run: | |
| 31 |
make html |
| 32 |
git rm -rf docs |
| 33 |
mv _build/html docs |
| 34 |
touch docs/.nojekyll |
| 35 |
- name: Push changes |
| 36 |
run: | |
| 37 |
git config --global user.email "[email protected]" |
| 38 |
git config --global user.name "$GITHUB_ACTOR" |
| 39 |
git add docs |
| 40 |
if [ -n "$(git status --porcelain)" ] |
| 41 |
then |
| 42 |
git commit docs -m "Sphinx rebuild ($(git rev-parse --short gh-pages))." |
| 43 |
git push origin gh-pages |
| 44 |
fi |