chore(deps): update rossjrw/pr-preview-action digest to 5fd5f8e #204
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'release-*' # Support version branches | |
| pull_request: | |
| branches: | |
| - main | |
| - 'release-*' | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - closed | |
| workflow_dispatch: | |
| permissions: | |
| contents: write # to write the built page to the branch | |
| pull-requests: write # to leave a comment with the preview URL | |
| concurrency: | |
| # set separate concurrency groups for each version branch and PR | |
| group: ${{ github.event_name == 'pull_request' && format('pages-preview-{0}', github.event.pull_request.number) || format('pages-{0}', github.ref_name) }} | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - id: configure | |
| uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 | |
| # Extract version from branch name for versioned deployments | |
| - id: set-version | |
| name: Set documentation version | |
| run: | | |
| if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
| echo "version=main" >> $GITHUB_OUTPUT | |
| elif [[ "${{ github.ref }}" == refs/heads/release-* ]]; then | |
| echo "version=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT | |
| else | |
| echo "version=" >> $GITHUB_OUTPUT | |
| fi | |
| - run: npm ci | |
| - run: npm run build | |
| env: | |
| DOCS_VERSION: ${{ steps.set-version.outputs.version }} | |
| PAGES_BASE: ${{ github.event_name == 'pull_request' && format('pr-preview/pr-{0}', github.event.pull_request.number) || '' }} | |
| # deploy the PR to a preview URL | |
| - uses: rossjrw/pr-preview-action@5fd5f8e2f88e735fc3d1151302b32242037e3962 # v1 | |
| if: ${{ github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork }} | |
| with: | |
| source-dir: .vitepress/dist | |
| # Deploy versioned docs to GitHub Pages | |
| # This creates a folder structure on gh-pages branch for each version: | |
| # gh-pages/ | |
| # ├── index.html ← root redirect (deployed from main branch) | |
| # ├── main/ ← from main branch | |
| # ├── release-0.1/ ← from release-0.1 branch | |
| # └── pr-preview/ ← PR previews (preserved via clean-exclude) | |
| # | |
| # Each version is independent - deploying main/ won't affect release-0.1/ | |
| # The target-folder determines which subdirectory receives the build output | |
| - uses: JamesIves/github-pages-deploy-action@9d877eea73427180ae43cf98e8914934fe157a1a # v4 | |
| if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-')) }} | |
| with: | |
| folder: .vitepress/dist | |
| branch: gh-pages | |
| target-folder: ${{ steps.set-version.outputs.version }} | |
| clean-exclude: pr-preview | |
| force: false | |
| # Deploy root index.html redirect from main branch only | |
| # This ensures the site root redirects to the default version (release-0.1) | |
| - uses: JamesIves/github-pages-deploy-action@9d877eea73427180ae43cf98e8914934fe157a1a # v4 | |
| if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' }} | |
| with: | |
| folder: . | |
| branch: gh-pages | |
| target-folder: . | |
| clean: false | |
| clean-exclude: | | |
| pr-preview | |
| main | |
| release-* | |
| force: false | |
| include: index.html |