Convert deployment from Vercel to GitHub Pages static export#3
Merged
Merged
Conversation
- Configure next.config.ts for static export (output: 'export', basePath, trailingSlash) - Replace Node.js Buffer API with browser-compatible btoa/atob in encryption.ts - Move document creation logic from API route to client-side Firebase operations - Restructure doc viewer from dynamic route [id] to query params (?id=) - Replace Vercel deployment workflow with GitHub Pages deployment workflow - Fix ESLint error (setState in effect) and remove unused docId parameter - Update README.md with GitHub Pages deployment instructions Co-authored-by: AshenWijesingha <66056859+AshenWijesingha@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issues and deploy web page on GitHub Pages
Convert deployment from Vercel to GitHub Pages static export
Mar 15, 2026
Member
|
Required Secrets for Deployment: Instead of using vercel, please develop this completely hosted within GitHub Pages. @copilot |
Contributor
Author
This is already done in commit
To complete setup: go to Settings → Pages and select GitHub Actions as the source, then merge to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Next.js app was configured for Vercel deployment with API routes and dynamic server-side rendering — incompatible with GitHub Pages. Converts the entire app to a fully client-side static export.
Static export configuration (
next.config.ts)output: "export",trailingSlash: true,images.unoptimized: truebasePath/assetPrefixdriven byNEXT_PUBLIC_BASE_PATHenv varEliminate server-side dependencies
src/app/api/create-doc/route.ts— API routes don't work in static export. Document creation now writes directly to Firestore from the client inpage.tsx.Bufferwithbtoa/atobinencryption.ts—Bufferis Node-only.Restructure dynamic route to query params
Dynamic
doc/[id]/page.tsxrequiresgenerateStaticParamsin static export, which is impossible for arbitrary doc IDs. Replaced withdoc/page.tsxusinguseSearchParams():The viewer component (
DocumentViewer.tsx) and not-found view (NotFoundView.tsx) are now pure client components — nonotFound()server function.GitHub Pages workflow (
.github/workflows/nextjs.yml)actions/upload-pages-artifact@v3+actions/deploy-pages@v4ESLint fixes
react-hooks/set-state-in-effecterror by initializing state fromsearchParamsdirectly instead of setting it inuseEffectdocIdprop fromDocumentViewerWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
fonts.googleapis.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/SecureDoc-Portal/SecureDoc-Portal/node_modules/.bin/next build(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.