Skip to content

Add PR preview via GitHub Actions #1

Add PR preview via GitHub Actions

Add PR preview via GitHub Actions #1

Workflow file for this run

name: Deploy PR preview
on:
pull_request:
types: [opened, reopened, synchronize, closed]
concurrency: preview-${{ github.ref }}
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install and build
if: github.event.action != 'closed'
run: |
npm install
npm run build
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./dist
preview-branch: gh-pages
umbrella-dir: pr-preview