Jiseoup/showmycodePublic
EN|KO
  • 코드
  • 커밋
  • 풀 리퀘스트
← 목록으로

fix: render home at request time so CI builds without secrets

JiseoupJiseoup · 2026년 6월 23일8ff6646

변경된 파일3개+5 -5

변경된 파일

+5 -5 · 3개

@@ -37,7 +37,3 @@ jobs:
- name: Build
run: npm run build
- env:
- GITHUB_PAT: ${{ secrets.GITHUB_PAT }}
- GITHUB_OWNER: ${{ secrets.GITHUB_OWNER }}
- GITHUB_REPOS: ${{ secrets.GITHUB_REPOS }}
@@ -13,7 +13,7 @@ export default async function LangLayout({
return <>{children}</>;
}
-// Pre-render both locale roots at build time to avoid a dynamic fallback on first visit.
+// Supported locale roots — not prerendered, since the home page renders at request time.
export function generateStaticParams() {
return [{ lang: "ko" }, { lang: "en" }];
}
@@ -1,3 +1,4 @@
+import { connection } from "next/server";
import { getAllowedRepos, getRepo } from "@/lib/github";
import { RepoCard } from "@/components/RepoCard";
import { BrandLink } from "@/components/BrandLink";
@@ -8,6 +9,9 @@ import { getDictionary, type Locale } from "@/lib/i18n.server";
const OWNER = process.env.GITHUB_OWNER!;
export default async function HomePage({ params }: { params: Promise<{ lang: string }> }) {
+ // Render at request time, not at build, so the build needs no GitHub secrets (60s cache still applies).
+ await connection();
+
const { lang } = await params;
const locale = lang as Locale;
const [repos] = await Promise.all([