[v0.0.3] 2025-08-23 #26
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
| name: Build and Deploy Documentation | |
| on: | |
| push: | |
| branches: [ "master", "main" ] | |
| pull_request: | |
| branches: [ "master", "main" ] | |
| types: [opened, synchronize] | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| name: Build Documentation | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive # Include helios-core submodule for doc assets | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y doxygen graphviz | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install doxypypy | |
| pip install -r requirements.txt | |
| pip install -e . | |
| - name: Verify Doxygen installation | |
| run: | | |
| doxygen --version | |
| doxypypy --help | |
| - name: Build documentation | |
| run: | | |
| # Create output directory | |
| mkdir -p docs/generated | |
| # Build documentation with Doxygen | |
| doxygen docs/Doxyfile.python | |
| # Verify documentation was generated | |
| ls -la docs/generated/html/ | |
| echo "✓ Documentation built successfully" | |
| - name: Setup Pages | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/generated/html/ | |
| deploy-docs: | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build-docs | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| # Job for PR documentation preview (build only, no deploy) | |
| preview-docs: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| name: Preview Documentation (PR) | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y doxygen graphviz | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install doxypypy | |
| pip install -r requirements.txt | |
| pip install -e . | |
| - name: Build documentation (preview) | |
| run: | | |
| mkdir -p docs/generated | |
| doxygen docs/Doxyfile.python | |
| echo "✓ Documentation preview built successfully" | |
| - name: Upload preview artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: documentation-preview | |
| path: docs/generated/html/ | |
| retention-days: 7 |