name: Documentation site on: push: branches: [main] paths: - "docs/**" - "package.json" - "package-lock.json" - ".nvmrc" - ".github/workflows/pages.yml" pull_request: branches: [main] paths: - "docs/**" - "package.json" - "package-lock.json" - ".nvmrc" - ".github/workflows/pages.yml" workflow_dispatch: permissions: contents: read concurrency: group: pages-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: HUSKY: "0" jobs: build: name: Build documentation runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version-file: .nvmrc cache: npm - run: npm ci - run: npm run docs:build - uses: actions/upload-pages-artifact@v4 if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' with: path: docs/.vitepress/dist deploy: name: Publish documentation if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' needs: build runs-on: ubuntu-latest permissions: pages: write id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - uses: actions/configure-pages@v5 - uses: actions/deploy-pages@v4 id: deployment