From 639b120ef636a59e7209f9177af760fc8d279569 Mon Sep 17 00:00:00 2001 From: Pranav Bhave <90584946+Cubits11@users.noreply.github.com> Date: Sat, 24 Oct 2026 22:47:50 -0400 Subject: [PATCH] deploy: serve the visual essay from GitHub Pages under /ghost-visualizer/ Phase 1 of docs/VISION-LEGACY-PLAN.md (PR #2). - vite.config.ts: base "/ghost-visualizer/". Built JS and CSS bytes are unchanged (index-DXagehBe.js, index-B0goTY0_.css); only index.html URLs move. - .github/workflows/deploy.yml: tests, copy lint, typecheck and build on every pull request; the build also asserts the Pages base path and that the receipt file in dist/ is byte-identical to public/evidence/. Deploy runs only on push to main. Actions are pinned by commit SHA. - LICENSE: MIT, same text as cc-framework, year 2026. README.md is deliberately untouched: the site's GV-001 fails its registry run if README.md on the default branch differs from bf8d87b (plan section 6.1). Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/deploy.yml | 77 ++++++++++++++++++++++++++++++++++++ LICENSE | 21 ++++++++++ vite.config.ts | 3 ++ 3 files changed, 101 insertions(+) create mode 100644 .github/workflows/deploy.yml create mode 100644 LICENSE diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..84e8bf5 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,77 @@ +name: Deploy + +# Every pull request runs the checks and the build. Only a push to main deploys. +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + build: + name: checks and build + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: 22 + cache: npm + + - name: Install + run: npm ci + + - name: Unit tests + run: npm test + + - name: Copy safety lint + run: npm run lint:vis001-copy + + - name: Typecheck and build + run: npm run build + + - name: Built assets use the Pages base path + run: | + set -eu + grep -Eq '(src|href)="/ghost-visualizer/assets/' dist/index.html + if grep -E '(src|href)="/[^g]' dist/index.html; then + echo "dist/index.html references a path outside /ghost-visualizer/" >&2 + exit 1 + fi + + - name: Receipt file is in the build and unchanged + run: | + set -eu + cmp dist/evidence/sample-receipt.json public/evidence/sample-receipt.json + sha256sum dist/evidence/sample-receipt.json + + - name: Package the site + if: github.event_name != 'pull_request' + uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 + with: + path: dist + + deploy: + name: deploy to GitHub Pages + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + needs: build + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4faf45e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Cubits11 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vite.config.ts b/vite.config.ts index 081c8d9..1666f76 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,5 +2,8 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; export default defineConfig({ + // GitHub Pages serves this repository at /ghost-visualizer/. A custom domain + // would serve from "/" and need this changed. + base: "/ghost-visualizer/", plugins: [react()], });