Skip to content

add PR preview concept #1

add PR preview concept

add PR preview concept #1

Workflow file for this run

# .github/workflows/preview.yml
# This is a basic workflow takes care of building and deploying
# client when creating merge request
name: Deploy PR previews
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed # pr-preview-action will do cleanup here, but build steps can be skipped
# do not allow running multiple of pipelines for this PR in parallel
concurrency: preview-${{ github.ref }}
jobs:
deploy-preview:
runs-on: ubuntu-22.04
permissions:
contents: write
pages: write
pull-requests: write
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/checkout@v4
- if: github.event.action != 'closed'
run: |
npm install
npm run docs:build -- --base /${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.number }}/
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: .vitepress/dist/