Merge pull request #81 from ucl-cssb/Fontanapink/issue78 #33
This file contains 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 and Deploy Documentation | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pandoc | |
run: sudo apt-get -y install pandoc | |
- name: Set up Conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: "3.10" | |
- name: Create mimic_env from environment.yml | |
run: conda env create -f environment.yml | |
- name: Activate mimic_env | |
run: | | |
eval "$(conda shell.bash hook)" | |
conda activate mimic_env | |
- name: Install Documentation Dependencies | |
run: | | |
# Installing additional dependencies not in environment.yml | |
conda install sphinx sphinx-rtd-theme nbsphinx ipykernel furo sphinx-autoapi recommonmark | |
- name: Generate API documentation | |
run: sphinx-apidoc -o docs/source/ ./ setup.py | |
- name: Build Sphinx documentation | |
run: | | |
cd docs | |
make clean | |
make html | |
touch build/html/.nojekyll # Create the .nojekyll file | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/build/html |