Skip to content

feat(stage6): static-JSON-shard UI rewrite on GitHub Pages — US1–US8 #13

feat(stage6): static-JSON-shard UI rewrite on GitHub Pages — US1–US8

feat(stage6): static-JSON-shard UI rewrite on GitHub Pages — US1–US8 #13

Workflow file for this run

name: pr-preview
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'site/**'
- '.github/workflows/pr-preview.yml'
workflow_dispatch:
permissions:
contents: write
pages: write
deployments: write
pull-requests: read
concurrency:
group: deploy-ui-preview-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
preview:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
environment:
name: pr-preview-${{ github.event.pull_request.number }}
url: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr-${{ github.event.pull_request.number }}/
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node 20 + pnpm
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Enable pnpm
run: npm install --global pnpm@10
- name: Install site deps
working-directory: site
run: pnpm install --frozen-lockfile
- name: Run JS unit tests (Vitest)
working-directory: site
run: pnpm test:unit --run
- name: Build site (PR preview)
working-directory: site
env:
BASE_PATH: /pr-${{ github.event.pull_request.number }}
VITE_BUILD_SHA: ${{ github.event.pull_request.head.sha }}
VITE_BUILD_AT: ${{ github.event.pull_request.head.repo.pushed_at }}
VITE_DATA_PACKAGE_URL: ${{ vars.OHBM2026_UI_DATA_PACKAGE_URL }}
run: |
export VITE_BUILD_SHA_SHORT="${VITE_BUILD_SHA:0:7}"
pnpm build
- name: Publish to gh-pages /pr-${{ github.event.pull_request.number }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site/build
publish_branch: gh-pages
destination_dir: pr-${{ github.event.pull_request.number }}
keep_files: false
enable_jekyll: false
commit_message: 'preview(ui): pr-${{ github.event.pull_request.number }} ${{ github.sha }}'