From 773fc8a27c84ef9820331172c955f74a12e48c70 Mon Sep 17 00:00:00 2001 From: Hasnae Date: Sat, 14 Mar 2026 22:24:48 +1100 Subject: [PATCH 1/3] Add GitHub Pages deployment workflow Set Vite base path for GitHub Pages subdirectory and add a deploy workflow that builds and publishes to Pages on pushes to main. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/deploy.yml | 44 ++++++++++++++++++++++++++++++++++++ web/vite.config.ts | 1 + 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..7db0fea --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,44 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [main] + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 24 + cache: npm + + - run: npm ci + + - name: Build + run: npm run build + + - uses: actions/upload-pages-artifact@v3 + with: + path: web/dist + + deploy: + needs: build + runs-on: ubuntu-24.04 + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/web/vite.config.ts b/web/vite.config.ts index ca7be6f..c6c9d6d 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -6,6 +6,7 @@ import { TanStackRouterVite } from "@tanstack/router-plugin/vite"; // https://vite.dev/config/ export default defineConfig({ + base: "/vibe-coded/", plugins: [TanStackRouterVite({ target: "react" }), react(), tailwindcss()], resolve: { alias: { From 8e6b3717b008df727e7843f758a9eabacf2a5388 Mon Sep 17 00:00:00 2001 From: Hasnae Date: Sat, 14 Mar 2026 22:27:05 +1100 Subject: [PATCH 2/3] Rename Game Gallery to Vibe Coded Update title, header, and PWA manifest. Game views keep "Back to gallery" navigation text as intended. Co-Authored-By: Claude Opus 4.6 (1M context) --- web/index.html | 4 ++-- web/public/site.webmanifest | 4 ++-- web/src/components/app-layout.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/index.html b/web/index.html index 4c45aa7..8a5283e 100644 --- a/web/index.html +++ b/web/index.html @@ -3,7 +3,7 @@ - Game Gallery + Vibe Coded @@ -12,7 +12,7 @@ - +
-

Game Gallery

+

Vibe Coded

From 49ae5f9a7cf46db5bda1f01d3d197c6172c8cf47 Mon Sep 17 00:00:00 2001 From: Hasnae Date: Sat, 14 Mar 2026 22:29:24 +1100 Subject: [PATCH 3/3] Fix SPA routing on GitHub Pages Add basepath to TanStack Router so routes resolve correctly under /vibe-coded/. Copy index.html to 404.html at build time so GitHub Pages serves the SPA for all routes on refresh. Co-Authored-By: Claude Opus 4.6 (1M context) --- web/src/main.tsx | 2 +- web/vite.config.ts | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/web/src/main.tsx b/web/src/main.tsx index 2d05ee9..e3215fc 100644 --- a/web/src/main.tsx +++ b/web/src/main.tsx @@ -5,7 +5,7 @@ import { ThemeProvider } from "@/components/theme-provider"; import { routeTree } from "./routeTree.gen"; import "./index.css"; -const router = createRouter({ routeTree }); +const router = createRouter({ routeTree, basepath: "/vibe-coded" }); declare module "@tanstack/react-router" { interface Register { diff --git a/web/vite.config.ts b/web/vite.config.ts index c6c9d6d..6370867 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -1,13 +1,32 @@ +import fs from "fs"; import path from "path"; -import { defineConfig } from "vite"; +import { defineConfig, type Plugin } from "vite"; import react from "@vitejs/plugin-react"; import tailwindcss from "@tailwindcss/vite"; import { TanStackRouterVite } from "@tanstack/router-plugin/vite"; +function spaFallback(): Plugin { + return { + name: "spa-fallback", + closeBundle() { + const dist = path.resolve(__dirname, "dist"); + fs.copyFileSync( + path.join(dist, "index.html"), + path.join(dist, "404.html"), + ); + }, + }; +} + // https://vite.dev/config/ export default defineConfig({ base: "/vibe-coded/", - plugins: [TanStackRouterVite({ target: "react" }), react(), tailwindcss()], + plugins: [ + TanStackRouterVite({ target: "react" }), + react(), + tailwindcss(), + spaFallback(), + ], resolve: { alias: { "@": path.resolve(__dirname, "./src"),