rand orht #571
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: deploy-docs | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
# runs-on: ubuntu-latest # this uses ubuntu-20.04 (not 22.04) and installs old doxygen. | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
# Build doxygen files in /docs/doxygen/output/html | |
- name: Build doxygen | |
run: | | |
sudo apt-get update | |
sudo apt-get install doxygen -y | |
sudo apt-get install graphviz -y | |
cd docs/doxygen | |
doxygen doxyfile.in | |
# Compile package with in-source build | |
# Use force-reinstall to downgrade matplotlib if necessary to be compatible with seaborn | |
- name: Install | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install --force-reinstall -r requirements_plot.txt | |
export CYTHON_BUILD_FOR_DOC=1 | |
python setup.py install # do not use "pip install ." as it fails | |
# Build sphinx in /docs/build, copy /docs/doxygen/output/html to /docs/build/doxygen | |
- name: Build Sphinx | |
run: | | |
sudo apt-get install pandoc -y | |
python -m pip install -r docs/requirements.txt | |
export PATH=$HOME/.local/bin:$PATH | |
make clean html --directory=docs | |
touch docs/build/html/.nojekyll | |
echo 'Visit [Documentation](https://ameli.github.io/imate/index.html).' > docs/build/html/README.md | |
mkdir -p docs/build/html/doxygen | |
cp -r docs/doxygen/output/html docs/build/html/doxygen | |
# Deploy to github pages | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: docs/build/html | |
branch: gh-pages |