Skip to content

adds config for readthedocs #5

adds config for readthedocs

adds config for readthedocs #5

Workflow file for this run

name: Documentation
on:
push:
branches: [main]
pull_request:
branches: [main]
# Update permissions to include pages and id-token
permissions:
contents: write
pages: write
id-token: write
jobs:
build-docs:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: |
poetry install --with docs
- name: Copy LICENSE to docs
run: cp LICENSE docs/source/
- name: Generate API documentation
run: |
poetry run sphinx-apidoc -o docs/source/ hydrowizard
- name: Build documentation
run: |
cd docs
poetry run make html
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs/build/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
if: github.event_name == 'push' && github.ref == 'refs/heads/main'