From 96d152f5922f930bad37fbb45aee51300e962ef7 Mon Sep 17 00:00:00 2001 From: Sean O'Connor Date: Wed, 26 Aug 2026 20:06:52 -0400 Subject: [PATCH] Deploy website to GitHub Pages --- .github/workflows/deploy-pages.yml | 65 ++++++++++++++++++++++++++++++ README.md | 7 ++++ next.config.js | 9 +++++ public/.nojekyll | 1 + src/app/robots.ts | 2 + tsconfig.json | 15 ++----- 6 files changed, 87 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/deploy-pages.yml create mode 100644 public/.nojekyll diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 0000000..4d7130a --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -0,0 +1,65 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [master] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.3.14 + + - name: Configure GitHub Pages + uses: actions/configure-pages@v5 + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Check source + run: bun run check + + - name: Prepare static-only routes + run: | + rm -f src/proxy.ts + rm -rf src/app/api src/app/login + rm -rf "src/app/(marketing)/beta" + rm -rf "src/app/(marketing)/executive-summary" + rm -rf "src/app/(marketing)/landscape" + + - name: Build static site + run: bun run build + env: + GITHUB_PAGES: "true" + + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v4 + with: + path: ./out + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index a035f0f..cbce8a1 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,13 @@ bun run build bun run start ``` +## GitHub Pages + +Pushes to `master` also publish a static build to GitHub Pages through +`.github/workflows/deploy-pages.yml`. The Pages build keeps the public product +site and partner materials, while omitting the optional server-only password +gate and legacy redirect routes that cannot run on static hosting. + Screenshots live in `public/screenshots/`. Every route uses the same fresh, precomposited iPhone 17 Pro assets in `public/screenshots/product-bezel-2026-08-24-unified-type/`; there are no raw or diff --git a/next.config.js b/next.config.js index 92a0f54..f23b1d6 100644 --- a/next.config.js +++ b/next.config.js @@ -4,10 +4,19 @@ */ import "./src/env.js"; +const isGitHubPages = process.env.GITHUB_PAGES === "true"; + /** @type {import("next").NextConfig} */ const config = { + ...(isGitHubPages + ? { + output: "export", + trailingSlash: true, + } + : {}), images: { qualities: [75, 92], + unoptimized: isGitHubPages, }, }; diff --git a/public/.nojekyll b/public/.nojekyll new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/public/.nojekyll @@ -0,0 +1 @@ + diff --git a/src/app/robots.ts b/src/app/robots.ts index 82327f4..e154f87 100644 --- a/src/app/robots.ts +++ b/src/app/robots.ts @@ -1,5 +1,7 @@ import type { MetadataRoute } from "next"; +export const dynamic = "force-static"; + export default function robots(): MetadataRoute.Robots { return { rules: { diff --git a/tsconfig.json b/tsconfig.json index 191a8f4..44a413f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,11 +14,7 @@ "noUncheckedIndexedAccess": true, "checkJs": true, /* Bundled projects */ - "lib": [ - "dom", - "dom.iterable", - "ES2022" - ], + "lib": ["dom", "dom.iterable", "ES2022"], "noEmit": true, "module": "ESNext", "moduleResolution": "Bundler", @@ -32,9 +28,7 @@ /* Path Aliases */ "baseUrl": ".", "paths": { - "~/*": [ - "./src/*" - ] + "~/*": ["./src/*"] } }, "include": [ @@ -46,8 +40,5 @@ ".next/types/**/*.ts", ".next/dev/types/**/*.ts" ], - "exclude": [ - "node_modules", - "generated" - ] + "exclude": ["node_modules", "generated", "out"] }