Skip to content

Setup pr preview

Setup pr preview #4

Workflow file for this run

name: Deploy PR Preview
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy-pr:
runs-on: ubuntu-latest
environment:
name: pr-${{ github.event.number }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Set environment variables
run: |
echo "NEXT_PUBLIC_BASE_PATH=/tskaigi2025-web-site/pr-${{ github.event.number }}" >> $GITHUB_ENV
- run: pnpm build
- uses: actions/upload-pages-artifact@v3
with:
path: out
- uses: actions/deploy-pages@v4
id: deployment