Skip to content

init preview builds for PRs #6

init preview builds for PRs

init preview builds for PRs #6

Workflow file for this run

# .github/workflows/preview.yml
name: Deploy PR previews
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
label:
types:
- preview
concurrency: preview-${{ github.ref }}
jobs:
deploy-preview:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
- name: Get submodules
run: git submodule init && git submodule update --remote --merge
- name: Install and Build
if: github.event.action != 'closed' # You might want to skip the build if the PR has been closed
env:
pr: ${{ github.event.number }}
run: |
echo "pr=$pr" >> $GITHUB_ENV
yarn install --frozen-lockfile
BASEURL='/pr-preview/pr-$pr' yarn build
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./build/