mirror of
https://github.com/samvallad33/vestige.git
synced 2026-07-02 22:01:01 +02:00
ci(pages): deploy dashboard to GitHub Pages with subpath-aware base
The github-pages deployment showed a red X: actions/configure-pages@v5 ran with enablement:true, but Pages was never enabled in repo settings and the default GITHUB_TOKEN cannot create a Pages site, so deploy failed with "Resource not accessible by integration". The launch-kit revert then deleted the workflow entirely, leaving nothing to deploy. - Restore a modernized pages.yml (Pages now enabled via API, so no enablement hack; actions/checkout@v5 + Node 24 off the deprecated Node 20). - Make the dashboard base path env-driven (VESTIGE_BASE_PATH), defaulting to /dashboard for local/embedded use and overridden to /vestige in CI so assets resolve at the Pages project subpath instead of 404ing. - Workflow builds the dashboard under /vestige and writes a root-level redirect index.html so the bare Pages URL lands on the dashboard. - Rebuild the committed dashboard artifact (was stale at 2.1.23) to 2.1.27. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b8212feb15
commit
79b1026a65
112 changed files with 106 additions and 22 deletions
79
.github/workflows/pages.yml
vendored
Normal file
79
.github/workflows/pages.yml
vendored
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
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
|
||||
|
||||
- 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>…</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
|
||||
Loading…
Add table
Add a link
Reference in a new issue