This repository was archived by the owner on Feb 7, 2025. It is now read-only.
docs #23
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
# Combination of https://github.com/RobinMagnet/pyFM/blob/master/.github/workflows/documentation.yml | |
# and https://github.com/r-lib/pkgdown/blob/main/.github/workflows/pkgdown.yaml | |
name: docs | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build_documentation: | |
name: Build Documentation | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
repository: 'StochasticTree/stochtree' | |
submodules: 'recursive' | |
- name: Setup Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Install Package with Relevant Dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r python_docs/requirements.txt | |
pip install . | |
- name: Build HTML | |
run: | | |
sphinx-build -M html python_docs/source/ python_docs/_build/ | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: | |
python_docs/_build/html/ | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
if: github.ref == 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: python_docs/_build/html |