|
| 1 | +name: Build & Deploy Doxygen Docs |
| 2 | + |
| 3 | +# Run on pushes to the default branch and on PRs targeting it. |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [ main ] |
| 7 | + pull_request: |
| 8 | + branches: [ main ] |
| 9 | + |
| 10 | +# Permissions needed for the deploy‑pages action. |
| 11 | +permissions: |
| 12 | + contents: read # checkout |
| 13 | + pages: write # publish to GitHub Pages |
| 14 | + id-token: write # OIDC token for the deploy action |
| 15 | + |
| 16 | +jobs: |
| 17 | + build-docs: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + |
| 21 | + # ------------------------------------------------- |
| 22 | + # 1️⃣ Checkout the repository |
| 23 | + # ------------------------------------------------- |
| 24 | + - name: Checkout repository |
| 25 | + uses: actions/checkout@v4 |
| 26 | + with: |
| 27 | + fetch-depth: 0 # required for proper git history when publishing |
| 28 | + |
| 29 | + # ------------------------------------------------- |
| 30 | + # 2️⃣ Install Doxygen + Graphviz (for UML/diagrams) |
| 31 | + # ------------------------------------------------- |
| 32 | + - name: Install Doxygen and Graphviz |
| 33 | + run: | |
| 34 | + sudo apt-get update |
| 35 | + sudo apt-get install -y doxygen graphviz |
| 36 | +
|
| 37 | + # ------------------------------------------------- |
| 38 | + # 3️⃣ Generate the documentation |
| 39 | + # ------------------------------------------------- |
| 40 | + - name: Build Doxygen docs |
| 41 | + run: | |
| 42 | + make docs |
| 43 | +
|
| 44 | + # ------------------------------------------------- |
| 45 | + # 4️⃣ Upload the generated HTML as an artifact |
| 46 | + # ------------------------------------------------- |
| 47 | + - name: Upload documentation artifact |
| 48 | + uses: actions/upload-pages-artifact@v3 |
| 49 | + with: |
| 50 | + path: ./docs/html |
| 51 | + |
| 52 | + # ------------------------------------------------- |
| 53 | + # 5️⃣ Deploy to GitHub Pages |
| 54 | + # ------------------------------------------------- |
| 55 | + - name: Deploy to GitHub Pages |
| 56 | + id: deployment |
| 57 | + uses: actions/deploy-pages@v4 |
0 commit comments