Deploy website to GitHub Pages
This commit is contained in:
@@ -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
|
||||||
@@ -65,6 +65,13 @@ bun run build
|
|||||||
bun run start
|
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,
|
Screenshots live in `public/screenshots/`. Every route uses the same fresh,
|
||||||
precomposited iPhone 17 Pro assets in
|
precomposited iPhone 17 Pro assets in
|
||||||
`public/screenshots/product-bezel-2026-08-24-unified-type/`; there are no raw or
|
`public/screenshots/product-bezel-2026-08-24-unified-type/`; there are no raw or
|
||||||
|
|||||||
@@ -4,10 +4,19 @@
|
|||||||
*/
|
*/
|
||||||
import "./src/env.js";
|
import "./src/env.js";
|
||||||
|
|
||||||
|
const isGitHubPages = process.env.GITHUB_PAGES === "true";
|
||||||
|
|
||||||
/** @type {import("next").NextConfig} */
|
/** @type {import("next").NextConfig} */
|
||||||
const config = {
|
const config = {
|
||||||
|
...(isGitHubPages
|
||||||
|
? {
|
||||||
|
output: "export",
|
||||||
|
trailingSlash: true,
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
images: {
|
images: {
|
||||||
qualities: [75, 92],
|
qualities: [75, 92],
|
||||||
|
unoptimized: isGitHubPages,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
import type { MetadataRoute } from "next";
|
import type { MetadataRoute } from "next";
|
||||||
|
|
||||||
|
export const dynamic = "force-static";
|
||||||
|
|
||||||
export default function robots(): MetadataRoute.Robots {
|
export default function robots(): MetadataRoute.Robots {
|
||||||
return {
|
return {
|
||||||
rules: {
|
rules: {
|
||||||
|
|||||||
+3
-12
@@ -14,11 +14,7 @@
|
|||||||
"noUncheckedIndexedAccess": true,
|
"noUncheckedIndexedAccess": true,
|
||||||
"checkJs": true,
|
"checkJs": true,
|
||||||
/* Bundled projects */
|
/* Bundled projects */
|
||||||
"lib": [
|
"lib": ["dom", "dom.iterable", "ES2022"],
|
||||||
"dom",
|
|
||||||
"dom.iterable",
|
|
||||||
"ES2022"
|
|
||||||
],
|
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Bundler",
|
"moduleResolution": "Bundler",
|
||||||
@@ -32,9 +28,7 @@
|
|||||||
/* Path Aliases */
|
/* Path Aliases */
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"~/*": [
|
"~/*": ["./src/*"]
|
||||||
"./src/*"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
@@ -46,8 +40,5 @@
|
|||||||
".next/types/**/*.ts",
|
".next/types/**/*.ts",
|
||||||
".next/dev/types/**/*.ts"
|
".next/dev/types/**/*.ts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": ["node_modules", "generated", "out"]
|
||||||
"node_modules",
|
|
||||||
"generated"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user