Deploy documentation #90
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 documentation | |
on: | |
workflow_run: | |
workflows: ["Build and test"] | |
branches: | |
- master | |
- ci | |
types: [completed] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-20.04 | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libcommute | |
run: | | |
git clone https://github.com/krivenko/libcommute | |
mkdir libcommute.build && pushd libcommute.build | |
cmake ../libcommute \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/libcommute.installed \ | |
-DTESTS=OFF \ | |
-DEXAMPLES=OFF | |
make install | |
popd | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools | |
pip install pybind11 numpy tox sphinx sphinx-rtd-theme myst-parser | |
- name: Build documentation | |
run: | | |
export LIBCOMMUTE_DIR=${GITHUB_WORKSPACE}/libcommute.installed | |
export LIBCOMMUTE_INCLUDEDIR=${LIBCOMMUTE_DIR}/include | |
pip install . | |
sphinx-build -M html docs/ build/sphinx | |
- name: Deploy documentation | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
token: ${{ secrets.GITHUB_TOKEN }} | |
folder: build/sphinx/html |