Skip to content

Commit e46151d

Browse files
committed
Fix gh pages deploy
1 parent a2102ca commit e46151d

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ jobs:
3131
- name: Use GH Pages layout (no navbar)
3232
run: cp frontend/app/layout.ghpages.tsx frontend/app/layout.tsx
3333

34+
- name: Stub non-data-model pages (avoids codegen dependency at build time)
35+
run: |
36+
stub='export default function Page() { return null; }'
37+
echo "$stub" > 'frontend/app/(home)/page.tsx'
38+
echo "$stub" > 'frontend/app/(admin)/dashboard/page.tsx'
39+
echo "$stub" > 'frontend/app/(driver)/map/page.tsx'
40+
echo "$stub" > 'frontend/app/(driver)/sessions/page.tsx'
41+
3442
- name: Build static export
3543
run: cd frontend && npm run build
3644
env:

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,22 @@ stop-atlas:
3636
clean-atlas:
3737
$(COMPOSE_ATLAS) rm -f -s $(ATLAS_SERVICES)
3838

39+
GHPAGES_PAGES := frontend/app/layout.tsx \
40+
frontend/app/\(home\)/page.tsx \
41+
frontend/app/\(admin\)/dashboard/page.tsx \
42+
frontend/app/\(driver\)/map/page.tsx \
43+
frontend/app/\(driver\)/sessions/page.tsx
44+
3945
preview-ghpages:
4046
cp frontend/app/layout.ghpages.tsx frontend/app/layout.tsx
47+
printf '%s\n' 'export default function Page() { return null; }' \
48+
| tee frontend/app/\(home\)/page.tsx \
49+
frontend/app/\(admin\)/dashboard/page.tsx \
50+
frontend/app/\(driver\)/map/page.tsx \
51+
frontend/app/\(driver\)/sessions/page.tsx > /dev/null
4152
(cd frontend && GITHUB_PAGES_PREVIEW=true NEXT_PUBLIC_GITHUB_PAGES=true npm run build) \
42-
|| (git checkout frontend/app/layout.tsx && exit 1)
43-
git checkout frontend/app/layout.tsx
53+
|| (git checkout $(GHPAGES_PAGES) && exit 1)
54+
git checkout $(GHPAGES_PAGES)
4455
rm -rf frontend/out/map frontend/out/sessions frontend/out/dashboard
4556
printf '<!doctype html><html><head><meta charset="utf-8"/><meta http-equiv="refresh" content="0;url=data-model/"/></head><body></body></html>\n' \
4657
> frontend/out/index.html

frontend/app/layout.ghpages.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Metadata } from "next";
22

3-
import { Providers } from "./providers";
43
import "./globals.css";
54

65
export const metadata: Metadata = {
@@ -23,9 +22,7 @@ export default function RootLayout({
2322
/>
2423
<style>{`[data-route="data-model"] { height: 100vh !important; }`}</style>
2524
</head>
26-
<body>
27-
<Providers>{children}</Providers>
28-
</body>
25+
<body>{children}</body>
2926
</html>
3027
);
3128
}

0 commit comments

Comments
 (0)