This project is configured to automatically deploy to GitHub Pages using GitHub Actions. Every time you push to the main branch, your site is automatically built and deployed.
Your project is fully configured for GitHub Pages deployment:
- ✅ GitHub Actions workflow (
.github/workflows/deploy.yml) - ✅ Static export enabled (
next.config.js) - ✅ Base path configured for GitHub Pages URL structure
- ✅ All 5 locales generated (en, zh, ja, es, fr)
- ✅ Default redirect to English version
- ✅ Jekyll disabled (
.nojekyllfile)
- Go to your repository on GitHub
- Click Settings (top navigation bar)
- Click Pages (left sidebar, under "Code and automation")
- Under "Build and deployment" section:
- Source: Click the dropdown
- Select "GitHub Actions" (NOT "Deploy from a branch")
- Click Save (if there's a save button)
What this does: Tells GitHub to use your .github/workflows/deploy.yml file to build and deploy your site.
Every time you push to the main branch, deployment happens automatically:
git add .
git commit -m "Your commit message"
git push origin mainWhat happens next:
- GitHub detects the push to
main - Triggers the "Deploy to GitHub Pages" workflow
- Builds your Next.js app as static HTML
- Deploys to GitHub Pages
- Your site updates in 2-3 minutes
- Go to your repository on GitHub
- Click the Actions tab (top navigation)
- You'll see the workflow run: "Deploy to GitHub Pages"
- Click on it to see detailed logs
- Wait for the green checkmark ✅ (usually 2-3 minutes)
Status indicators:
- 🟡 Yellow dot = Running
- ✅ Green checkmark = Success (your site is live!)
- ❌ Red X = Failed (check the logs for errors)
Once deployment succeeds, your site is available at:
Main URL:
https://<your-github-username>.github.io/advisor-calculator/
Direct language URLs:
- English:
https://<your-github-username>.github.io/advisor-calculator/en.html - Chinese:
https://<your-github-username>.github.io/advisor-calculator/zh.html - Japanese:
https://<your-github-username>.github.io/advisor-calculator/ja.html - Spanish:
https://<your-github-username>.github.io/advisor-calculator/es.html - French:
https://<your-github-username>.github.io/advisor-calculator/fr.html
Note: The root URL (/advisor-calculator/) automatically redirects to the English version.
The .github/workflows/deploy.yml file contains the automated deployment process:
- Trigger: Runs on every push to
mainbranch (or manual trigger) - Build Process:
- Checks out your code
- Sets up Node.js 20
- Installs dependencies with
npm ci - Builds the static site with
npm run build - Generates the
out/directory with all HTML/CSS/JS
- Deploy Process:
- Uploads the
out/directory as an artifact - Deploys to GitHub Pages
- Makes your site live
- Uploads the
The next.config.js file is configured for static export:
output: 'export', // Enables static HTML generation
basePath: '/advisor-calculator', // Matches your GitHub repo name
images: { unoptimized: true }, // Required for static exportThe src/app/[locale]/layout.tsx includes:
export function generateStaticParams() {
return locales.map((locale) => ({ locale }));
}This generates separate HTML files for all 5 languages during build time.
After running npm run build, the out/ directory contains:
out/
├── index.html # Redirects to en.html
├── en.html # English version
├── zh.html # Chinese version
├── ja.html # Japanese version
├── es.html # Spanish version
├── fr.html # French version
├── _next/ # JavaScript, CSS, fonts
│ └── static/
│ ├── css/
│ ├── chunks/
│ └── media/
├── .nojekyll # Disables Jekyll processing
├── favicon.ico
├── manifest.json
├── robots.txt
└── sitemap.xml
GitHub Pages serves these files directly from the out/ directory.
✅ Push to main branch - Automatic ✅ Manual trigger - Go to Actions > Deploy to GitHub Pages > Run workflow ❌ Pull requests - Does NOT deploy (only builds for testing) ❌ Other branches - Does NOT deploy
The workflow has these permissions (configured in deploy.yml):
contents: read- Read your repository codepages: write- Deploy to GitHub Pagesid-token: write- Required for Pages authentication
These are automatically granted by GitHub, no manual setup needed.
-
Check Actions logs:
- Go to Actions tab
- Click on the failed workflow run
- Expand the failed step to see error messages
-
Common issues:
- Build errors: Fix TypeScript/lint errors in your code
- Permission denied: Make sure GitHub Pages is enabled in Settings
- 404 on deployment: Verify
basePathmatches your repo name
-
Verify GitHub Pages is enabled:
- Settings > Pages > Source = "GitHub Actions"
-
Check deployment status:
- Actions tab should show successful deployment
-
Verify URL structure:
- Correct:
https://username.github.io/advisor-calculator/en.html - Wrong:
https://username.github.io/en.html(missing repo name)
- Correct:
This should not happen if built correctly, but if it does:
- Check browser console for 404 errors
- Verify basePath in
next.config.jsmatches repo name exactly - Clear browser cache and hard refresh (Cmd/Ctrl + Shift + R)
- Check build output: Run
npm run buildlocally to ensure no errors
- Wait 2-3 minutes after deployment succeeds
- Hard refresh your browser (Cmd/Ctrl + Shift + R)
- Check Actions tab to confirm latest deployment succeeded
- Verify you pushed to
mainbranch:git branchshould show* main
- Make your code changes locally
- Test locally:
npm run buildthen./test-github-pages.sh - Commit:
git add . && git commit -m "Your message" - Push:
git push origin main - Wait 2-3 minutes for automatic deployment
- Verify changes on live site
Test the build locally:
npm run build
./test-github-pages.shThen visit: http://localhost:8080/advisor-calculator/en.html
This simulates exactly how GitHub Pages will serve your site.
- Go to Actions tab
- See history of all workflow runs
- Each run shows:
- Commit message that triggered it
- Time it ran
- Duration
- Status (success/failure)
After deployment succeeds:
- Go to Settings > Pages
- You'll see: "Your site is live at [URL]"
- Click "Visit site" to open in new tab
GitHub creates a "github-pages" environment automatically:
- Go to your repository home page
- Look in the right sidebar under "Environments"
- Click "github-pages" to see deployment history
- Shows timestamps of each deployment
If you want to use your own domain instead of github.io:
-
Go to Settings > Pages
-
Under "Custom domain", enter your domain (e.g.,
advisor.example.com) -
Click Save
-
Add DNS records at your domain registrar:
- For apex domain (example.com):
- Add A records pointing to GitHub's IPs (see GitHub docs)
- For subdomain (www.example.com or advisor.example.com):
- Add CNAME record pointing to
<username>.github.io
- Add CNAME record pointing to
- For apex domain (example.com):
-
Wait for DNS propagation (up to 24 hours)
-
GitHub will automatically issue an SSL certificate
After adding custom domain, update next.config.js:
// Remove or comment out basePath for custom domain
// basePath: '/advisor-calculator',
// Or keep it if you want subdirectory on custom domain
basePath: '/calculator', // Would be: example.com/calculatorThen rebuild and push.
Use clear, descriptive commit messages:
# Good
git commit -m "Add Japanese translations for calculator tooltips"
git commit -m "Fix: CSS alignment issue on mobile devices"
git commit -m "Update: Improve scoring algorithm for advisor evaluation"
# Avoid
git commit -m "fix"
git commit -m "updates"
git commit -m "changes"Always test locally before pushing:
npm run build # Ensure build succeeds
npm run lint # Check for TypeScript/lint errors
./test-github-pages.sh # Test the actual outputFor team projects, protect the main branch:
- Settings > Branches > Add rule
- Branch name pattern:
main - Enable "Require status checks to pass before merging"
- Enable "Require branches to be up to date before merging"
Your static site is already optimized for GitHub Pages:
✅ Static HTML - No server processing, instant loading ✅ Global CDN - GitHub serves from edge locations worldwide ✅ Compressed assets - CSS and JS are minified ✅ Client-side only - All processing happens in the browser ✅ localStorage persistence - Data saved locally, no database needed
Expected performance:
- First load: < 2 seconds (includes downloading JS/CSS)
- Subsequent visits: < 0.5 seconds (browser cache)
- Page interactions: Instant (client-side React)
GitHub Pages enforces HTTPS automatically:
- ✅ All traffic encrypted
- ✅ Free SSL certificate
- ✅ Automatic renewal
- ✅ Cannot be disabled for
github.iodomains
Your app stores data in browser localStorage:
- ✅ Data never leaves user's device
- ✅ No server-side storage
- ✅ No tracking or analytics (unless you add them)
- ✅ GDPR-friendly by design
Your deployment workflow is:
- Make code changes locally
- Push to
mainbranch - GitHub Actions automatically builds and deploys
- Site updates in 2-3 minutes
- Users access at:
https://<username>.github.io/advisor-calculator/
Key files:
.github/workflows/deploy.yml- Deployment automationnext.config.js- Static export configurationpublic/index.html- Default page redirectpublic/.nojekyll- GitHub Pages configuration
No manual steps required after initial setup!
If you encounter issues:
- Check Actions logs for error messages
- Review this guide for configuration steps
- Test locally with
./test-github-pages.sh - Check GitHub Status: https://www.githubstatus.com/
- GitHub Pages docs: https://docs.github.com/en/pages
Last Updated: 2025-11-13 Build Status: ✅ Configured and Ready Deployment Method: GitHub Actions (Automatic)