vestige/.github/workflows/pages.yml
Sam Valladares 2359472588 ci(pages): pin pnpm version in deploy workflow
pnpm/action-setup needs an explicit version (root package.json has no
packageManager field). Match test.yml's pinned version: 10.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 17:48:11 -05:00

81 lines
2.2 KiB
YAML

name: Deploy GitHub Pages
on:
push:
branches: [main, feat/cloud-sync-mvp]
paths:
- 'apps/dashboard/**'
- '.github/workflows/pages.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment; let an in-progress run finish.
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
env:
# GitHub Pages serves this project repo from the /vestige/ subpath.
# The dashboard must be built with a matching base so every _app/ asset
# resolves instead of 404ing.
VESTIGE_BASE_PATH: /vestige
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v5
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build dashboard
run: pnpm --filter @vestige/dashboard build
- name: Assemble site root
run: |
rm -rf _site
mkdir -p _site/vestige
# Publish the dashboard under /vestige/ (matches VESTIGE_BASE_PATH).
cp -r apps/dashboard/build/* _site/vestige/
# Root-level redirect so visitors hitting the bare Pages URL land
# on the dashboard instead of a 404.
cat > _site/index.html <<'HTML'
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="refresh" content="0; url=./vestige/" />
<link rel="canonical" href="./vestige/" />
<title>Vestige</title>
<script>location.replace('./vestige/' + location.search + location.hash);</script>
</head>
<body>
<p>Redirecting to <a href="./vestige/">the Vestige dashboard</a>&hellip;</p>
</body>
</html>
HTML
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: _site
- id: deployment
uses: actions/deploy-pages@v4