52 lines
1.8 KiB
YAML
52 lines
1.8 KiB
YAML
name: Build and Deploy Sphinx Docs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
# - dev-documented
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Check out the repository
|
|
# Verify: curl -s "https://api.github.com/repos/actions/checkout/commits?sha=v6&until=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')&per_page=1" | jq -r '.[0].sha'
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Python
|
|
# Verify: curl -s "https://api.github.com/repos/actions/setup-python/commits?sha=v6&until=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')&per_page=1" | jq -r '.[0].sha'
|
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
pip install Sphinx==8.0.2 pydata-sphinx-theme==0.15.4 Jinja2==3.1.4 sphinx-copybutton==0.5.2
|
|
|
|
- name: Build Sphinx documentation
|
|
run: |
|
|
sphinx-build -b html doc/source doc/_build/html -v
|
|
|
|
- name: List generated HTML files
|
|
run: |
|
|
ls -l -R doc/_build/html
|
|
|
|
- name: Deploy to GitHub Pages
|
|
# Verify: curl -s "https://api.github.com/repos/peaceiris/actions-gh-pages/commits?sha=v4&until=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')&per_page=1" | jq -r '.[0].sha'
|
|
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_branch: documentation
|
|
publish_dir: doc/_build/html
|
|
destination_dir: docs
|
|
enable_jekyll: false
|