Skip to content

Documentation

Documentation #108

Workflow file for this run

name: Documentation
on: # Run action after unit test workflow is complete
workflow_run:
workflows: ['Ubuntu20 Py3.8']
types: [completed]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
site:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
# Only run if unit tests have been passed
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Set up Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Report host(s)
run: |
echo "Host: ${{ github.event.repository.name }}.docs"
# echo ::set-output name=branch::docs
echo "{branch}={docs}" >> $GITHUB_OUTPUT
id: config
# Generate documentation =====================================
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libyaml-cpp-dev -y
sudo apt-get install libeigen3-dev -y
sudo apt-get install libpython3.8 -y
sudo apt-get install libx11-6 -y
sudo apt-get install libsm6 -y
sudo apt-get install libxt6 -y
sudo apt-get install libglib2.0-0 -y
sudo apt-get install python3-sphinx -y
sudo apt-get install python3-numpydoc -y
sudo apt-get install python3-sphinx-rtd-theme -y
- name: Install Eigen # apt install of libeigen3-dev not working (paths?)
run: |
sudo wget -O Eigen.zip https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip
sudo unzip Eigen.zip
sudo mv eigen-*/Eigen /usr/local/include/
sudo rm -rf eigen-*
sudo rm -rf Eigen.zip
- name: Install project dependencies
run: |
pip install setuptools==65.5.0
pip install pip==21
make install
- name: Install HTML math dependencies
run: |
sudo apt-get install dvipng -y
sudo apt-get install texlive-latex-extra -y
- name: Generate
run: |
make doc
id: generate
- name: Stow
run: |
mkdir tmp
mv -v docs/build/_build/html/* tmp/
ls tmp/
- name: Switch
run: |
cd docs
git checkout docs
cd ..
- name: Clean
run: |
mkdir -p docs
rm -rf docs/*
- name: Ready up
run: |
mv -v tmp/* docs/
touch docs/.nojekyll
- name: Push
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
git add -A && git commit --allow-empty -m "Updated Documentation"
git push -u origin docs