name: Documentation # Deployed by the Release workflow after each release, from the release tag, so the site # documents released behavior and version. Dispatch manually to redeploy the latest release. on: workflow_call: inputs: ref: description: 'Release tag to build' type: string required: true workflow_dispatch: inputs: ref: description: 'Release tag to build; defaults to the latest v* tag' type: string required: false permissions: contents: read concurrency: group: pages cancel-in-progress: false jobs: build: if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 with: fetch-depth: 0 persist-credentials: false - name: Check out the release tag env: REF: ${{ inputs.ref }} run: | tag="${REF:-$(git describe --tags --abbrev=0 --match 'v*' origin/main)}" case "$tag" in v[0-9]*) ;; *) echo "::error::Expected a v release tag, got '$tag'."; exit 1 ;; esac git checkout --quiet "refs/tags/$tag" - uses: pnpm/action-setup@v6 - uses: actions/setup-node@v6 with: node-version-file: .nvmrc cache: pnpm - run: pnpm install --frozen-lockfile - run: pnpm build - run: pnpm docs:build - uses: actions/upload-pages-artifact@v4 with: path: packages/docs/build deploy: 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/deploy-pages@v4 id: deployment