name: Publish documentation to GitHub Pages permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: push: branches: ['main'] env: NODE_VERSION: 22.x jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - run: npm ci - run: npm run build:docs - uses: actions/upload-artifact@v4 with: name: docs-output path: ./docs retention-days: 1 deploy: needs: build environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest permissions: pages: write id-token: write steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Download build output uses: actions/download-artifact@v4 with: name: docs-output path: ./docs - name: Setup Pages uses: actions/configure-pages@v5 - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: './docs' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4