Build and deploy sphinx docs #130
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
name: Build and deploy sphinx docs | |
on: | |
push: | |
branches: main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-dev.txt | |
- name: Build documentation | |
run: | | |
cd docs/ | |
make html | |
- uses: actions/checkout@v4 | |
with: | |
ref: "gh-pages" | |
repository: ${{ github.repository }} | |
path: "gh-pages-docs" | |
- name: Deploy to GitHub Pages | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
rm -rf ./gh-pages-docs/* | |
mv -f ${{ github.workspace }}/docs/_build/html/* ./gh-pages-docs | |
cd ./gh-pages-docs | |
touch .nojekyll | |
git add . | |
git commit -m "Deploy documentation from GitHub Actions" --allow-empty | |
git push origin gh-pages |