Skip to content

Publish docs to GH pages #19

Publish docs to GH pages

Publish docs to GH pages #19

Workflow file for this run

name: Build and deploy sphinx docs
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: main
pull_request:
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
ls ./_build/html/
- uses: actions/checkout@v4
with:
ref: "gh-pages"
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Deploy to GitHub Pages
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
mv -f ${{ github.workspace }}/docs/_build/html/* .
touch .nojekyll
git add .
git commit -m "Deploy documentation from GitHub Actions" --allow-empty
git push origin gh-pages