Merge pull request #204 from scipy/optional_requirements #65
This file contains hidden or 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 & Deploy Docs | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
# Build the docs | |
docs-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "pip" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -e '.[doc]' | |
- name: Build Docs | |
run: | | |
sphinx-build -b html docs/ docs/build/ | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs-build | |
path: docs/build/ | |
# Deploy the docs to GitHub Pages | |
docs-deploy: | |
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
runs-on: ubuntu-latest | |
needs: docs-build | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
contents: write | |
pages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: docs-build | |
path: docs/build/ | |
- name: Deploy to GitHub pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: docs/build/ |