Skip to content

Creating Docs

Creating Docs #9

Workflow file for this run

name: Build and Deploy Sphinx Documentation
on:
push:
branches:
- main
- docs
pull_request:
branches:
- main
- docs
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: '3.12'
channels: conda-forge
channel-priority: true
auto-update-conda: true
auto-activate-base: true
- name: Create and activate conda environment
shell: bash -l {0}
run: |
conda env create -f environment.yml
conda activate desc_smokescreen
- name: Install package with docs extra
shell: bash -l {0}
run: |
conda activate desc_smokescreen
python -m pip install --upgrade pip
python -m pip install .[docs]
- name: Build Sphinx documentation
shell: bash -l {0}
run: |
conda activate desc_smokescreen
cd docs
python -m sphinx -b html source build
- name: Upload documentation to Read the Docs
env:
READTHEDOCS_PROJECT: ${{ secrets.READTHEDOCS_PROJECT }}
READTHEDOCS_TOKEN: ${{ secrets.READTHEDOCS_TOKEN }}
run: |
curl -X POST -d "project=${{ env.READTHEDOCS_PROJECT }}" -d "token=${{ env.READTHEDOCS_TOKEN }}" https://readthedocs.org/api/v2/webhook/${{ env.READTHEDOCS_PROJECT }}/