Added Python documentation generation. #9
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 to Pages | |
on: | |
push: | |
branches: | |
- master | |
- firmware-doc | |
- library-doc | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
# Default to bash | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Doxygen | |
run: sudo apt-get install doxygen graphviz fonts-freefont-ttf | |
- name: Run Doxygen | |
run: doxygen | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
cache: 'pip' | |
python-version: "3.12" | |
- name: 'Install requirements' | |
run: | | |
python -m venv .venv | |
source .venv/bin/activate | |
pip install -r requirements.txt | |
- name: 'Modify Actions PATH' | |
run: echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
- name: Generate documentation RST files | |
run: sphinx-apidoc -o docs api | |
- name: Generate documentation HTML | |
run: sphinx-build -b html docs docs/library | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ./docs | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |