name: Documentation # The site is built by `make docs`: Zensical renders the guides under docs/ # (see mkdocs.yml) and phpDocumentor renders the API reference into /api/. # Pull requests build only — the build is strict, so a broken internal link # fails CI instead of shipping a dead link to the site. on: push: branches: [main] pull_request: workflow_dispatch: permissions: contents: read concurrency: group: docs-${{ github.ref }} cancel-in-progress: true jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v7 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '8.4' coverage: "none" - name: Install Composer dependencies uses: "ramsey/composer-install@v4" - name: Install uv uses: astral-sh/setup-uv@v10.1.0 with: enable-cache: true - name: Build documentation run: make docs - name: Upload Pages artifact uses: actions/upload-pages-artifact@v5 with: path: ./site deploy: needs: build if: github.event_name != 'pull_request' runs-on: ubuntu-latest permissions: pages: write id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v5