Skip to content

Add playground support #2

Add playground support

Add playground support #2

Workflow file for this run

name: Deploy PR preview
permissions:
pages: write
id-token: write
contents: write
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
concurrency: preview-${{ github.ref }}
defaults:
run:
shell: bash
jobs:
build-preview:
if: github.event_name == 'pull_request_target' && github.event.action != 'closed'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Build Playground
run: |
pnpm install
pnpm build:playground
- uses: rossjrw/pr-preview-action@v1.6.0
with:
action: deploy
source-dir: ./packages/playground/out
preview-branch: previews
umbrella-dir: pr
# remove the preview page when the PR got closed
remove-preview:
if: github.event_name == 'pull_request_target' && github.event.action == 'closed'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
# checkout required for pr-preview-action to succeed,
# while the content will not be used
- name: Checkout
uses: actions/checkout@v4
- uses: rossjrw/pr-preview-action@v1.6.0
id: deployment
with:
action: remove
preview-branch: previews
umbrella-dir: pr