Skip to content

ci: add RSPRESS_BASE path in workflows for deployment and PR previews #36

ci: add RSPRESS_BASE path in workflows for deployment and PR previews

ci: add RSPRESS_BASE path in workflows for deployment and PR previews #36

Workflow file for this run

name: Deploy PR previews
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
concurrency: preview-${{ github.ref }}
jobs:
deploy-preview:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
pages: write
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: true
- name: Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
version: 9.12.2
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: .nvmrc
cache: 'pnpm'
- name: Install dependencies
if: github.event.action != 'closed'
run: pnpm install --frozen-lockfile
- name: Build project packages
if: github.event.action != 'closed'
run: pnpm run build
- name: Build tester package
if: github.event.action != 'closed'
working-directory: packages/tester
env:
NODE_ENV: production
RSPRESS_BASE: /${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.number }}/
run: pnpm run build
- name: Deploy preview
uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1.8.1
with:
source-dir: packages/tester/doc_build
preview-branch: gh-pages
qr-code: true
wait-for-pages-deployment: true