Skip to content

conflict#2

Open
violetguos wants to merge 1 commit into
masterfrom
feat-public-build
Open

conflict#2
violetguos wants to merge 1 commit into
masterfrom
feat-public-build

Conversation

@violetguos

Copy link
Copy Markdown
Owner

Done. Here's the summary:
What changed
File Change
next.config.ts output: 'export' + images.unoptimized + basePath when STATIC_MODE
src/lib/config.ts New — exports isStaticMode boolean from env var
src/app/layout.tsx Hides "New Plan" button in static mode
src/app/plans/[id]/page.tsx generateStaticParams, CRUD buttons via dynamic import (avoids bundling "use server" in static mode)
src/app/plans/[id]/plan-actions.tsx New — Edit/Delete button component (client component with server action)
src/app/plans/[id]/edit/page.tsx generateStaticParams, shows "Not Available" notice in static mode
src/app/plans/new/page.tsx Shows "Not Available" notice in static mode
src/app/products/[id]/page.tsx generateStaticParams
scripts/static-build.mjs New — temporarily stubs actions.ts during build (server actions aren't supported in static export)
.github/workflows/deploy.yml New — GitHub Actions: generate Prisma client → npm run build:static → upload → deploy
.nojekyll New — tells GitHub Pages not to process with Jekyll
How to deploy

  1. Push to GitHub — the Actions workflow will auto-deploy on push to main
  2. Enable GitHub Pages in repo Settings → Pages → Source: "GitHub Actions"
  3. Set NEXT_PUBLIC_BASE_PATH to /jherb-script (already in the workflow)
    If your repo name is different from jherb-script, update NEXT_PUBLIC_BASE_PATH in .github/workflows/deploy.yml.
    Local dev still works
    npm run dev # full CRUD with Server Actions
    npm run build # normal server build
    npm run build:static # static export (stubs actions.ts, restores after)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant