update docs #3
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: Documentation Build & Deploy | |
on: [push, pull_request, workflow_dispatch] # controls when the action will run | |
jobs: | |
build: | |
runs-on: ubuntu-latest # ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 # https://github.com/actions/checkout | |
- name: Setup Python | |
uses: actions/setup-python@v4 # https://github.com/actions/setup-python | |
with: | |
python-version: '3.11' | |
architecture: 'x64' | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install mkdocs pymdown-extensions # Mkdocs requirements | |
- name: Build API reference documentation | |
run: | | |
python3 -m venv .env # Virtual env to avoid dep. issues | |
source .env/bin/activate | |
pip install Sphinx sphinx_rtd_theme numpy msgpack-rpc-python | |
pushd PythonClient >/dev/null | |
./build_api_docs.sh | |
popd >/dev/null | |
cp -r PythonClient/docs/_build docs/api_docs/ # Copy generated files | |
deactivate | |
- name: Build AutonomySim documentation | |
run: ./build_docs.sh | |
# Only on commits to 'master' branch | |
- name: Deploy master branch | |
uses: peaceiris/actions-gh-pages@v3 # https://github.com/peaceiris/actions-gh-pages | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build_docs |