[v0.1.8] 2025-10-15 #79
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 | |
| fetch-depth: 0 # Fetch full history including tags | |
| - 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 graphviz wget | |
| # Install Doxygen 1.13.2 from source to match local build | |
| # Different Doxygen versions generate different anchor hashes, breaking search links | |
| wget https://www.doxygen.nl/files/doxygen-1.13.2.linux.bin.tar.gz | |
| tar -xzf doxygen-1.13.2.linux.bin.tar.gz | |
| sudo cp doxygen-1.13.2/bin/doxygen /usr/local/bin/ | |
| sudo chmod +x /usr/local/bin/doxygen | |
| - 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: Sync version to Doxygen config | |
| run: | | |
| # Get version from git tags (remove 'v' prefix if present) | |
| VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "unknown") | |
| if [ "$VERSION" = "unknown" ]; then | |
| echo "Warning: Could not determine version from git tags, using fallback" | |
| # Fallback to setuptools-scm if available | |
| VERSION=$(python -c "import setuptools_scm; print(setuptools_scm.get_version())" 2>/dev/null | sed 's/^v//' || echo "dev") | |
| fi | |
| echo "Updating Doxygen PROJECT_NUMBER to: $VERSION" | |
| sed -i "s/^PROJECT_NUMBER.*$/PROJECT_NUMBER = $VERSION/" docs/Doxyfile.python | |
| - 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 |