| 1 | name: Website |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - master |
| 7 | paths: |
| 8 | - 'docs/**' |
| 9 | - 'include/**' |
| 10 | - '.github/workflows/pages.yml' |
| 11 | pull_request: |
| 12 | branches: |
| 13 | - master |
| 14 | paths: |
| 15 | - 'docs/**' |
| 16 | - 'include/**' |
| 17 | - '.github/workflows/pages.yml' |
| 18 | workflow_dispatch: |
| 19 | |
| 20 | concurrency: |
| 21 | group: website-${{ github.ref }} |
| 22 | cancel-in-progress: true |
| 23 | |
| 24 | permissions: |
| 25 | contents: read |
| 26 | |
| 27 | jobs: |
| 28 | build: |
| 29 | name: Build website |
| 30 | runs-on: ubuntu-latest |
| 31 | steps: |
| 32 | - name: Check out repository |
| 33 | uses: actions/checkout@v6 |
| 34 | |
| 35 | - name: Set up Node.js |
| 36 | uses: actions/setup-node@v6 |
| 37 | with: |
| 38 | node-version: 24 |
| 39 | cache: npm |
| 40 | cache-dependency-path: docs/package-lock.json |
| 41 | |
| 42 | - name: Install Doxygen |
| 43 | run: | |
| 44 | sudo apt-get update |
| 45 | sudo apt-get install --yes --no-install-recommends doxygen graphviz |
| 46 | |
| 47 | - name: Install website dependencies |
| 48 | working-directory: docs |
| 49 | run: npm ci |
| 50 | |
| 51 | - name: Build website and API reference |
| 52 | working-directory: docs |
| 53 | run: npm run build |
| 54 | |
| 55 | - name: Check website artifact |
| 56 | run: | |
| 57 | test -f docs/.vitepress/dist/index.html |
| 58 | test -f docs/.vitepress/dist/codedoc/html/index.html |
| 59 | |
| 60 | - name: Configure GitHub Pages |
| 61 | if: github.event_name != 'pull_request' |
| 62 | uses: actions/configure-pages@v5 |
| 63 | |
| 64 | - name: Upload GitHub Pages artifact |
| 65 | if: github.event_name != 'pull_request' |
| 66 | uses: actions/upload-pages-artifact@v4 |
| 67 | with: |
| 68 | path: docs/.vitepress/dist |
| 69 | |
| 70 | deploy: |
| 71 | name: Deploy website |
| 72 | if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' |
| 73 | needs: build |
| 74 | runs-on: ubuntu-latest |
| 75 | permissions: |
| 76 | pages: write |
| 77 | id-token: write |
| 78 | environment: |
| 79 | name: github-pages |
| 80 | url: ${{ steps.deployment.outputs.page_url }} |
| 81 | steps: |
| 82 | - name: Deploy to GitHub Pages |
| 83 | id: deployment |
| 84 | uses: actions/deploy-pages@v4 |