Adding build developer documentation #4
This file contains hidden or 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
| # Documentation build and deployment workflow | |
| # Builds documentation using Doxygen + Sphinx + Breathe | |
| # Deploys to GitHub Pages on pushes to main branch | |
| name: Documentation | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - 'docs/**' | |
| - 'include/**' | |
| - '.github/workflows/docs.yml' | |
| pull_request: | |
| paths: | |
| - 'docs/**' | |
| - 'include/**' | |
| - '.github/workflows/docs.yml' | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Doxygen | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y doxygen | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r docs/requirements.txt | |
| - name: Build Doxygen XML | |
| working-directory: docs | |
| run: doxygen Doxyfile | |
| - name: Build Sphinx HTML | |
| working-directory: docs | |
| run: | | |
| sphinx-build -b html -D breathe_projects.rawtoaces=doxygen/xml . _build/html | |
| - name: Upload artifact for GitHub Pages | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/_build/html | |
| deploy-docs: | |
| # Only deploy on push to main | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| needs: build-docs | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |