This guide explains how to deploy the wedding website to GitHub Pages using GitHub Actions with fully functional form submissions and image loading.
The website is deployed as a static Next.js application to GitHub Pages with:
- ✅ All public-facing pages (Home, Events, Gallery, Live, Travel, Contact, RSVP)
- ✅ Working contact and RSVP forms (using Web3Forms API)
- ✅ All images and static assets
- ✅ Responsive design
- ✅ Mobile-friendly interface
Before deploying, you need to:
- GitHub Repository Access: Admin access to configure repository settings
- Web3Forms Account: Free account for form submissions (https://web3forms.com)
Web3Forms is a free service that enables form submissions without a backend server.
- Go to https://web3forms.com
- Click "Get Started for Free"
- Sign up with your email (GitHub login also available)
- Verify your email address
- Log in to your Web3Forms dashboard
- Click "Create New Form"
- Enter form name: "Wedding Website Contact Form"
- Set email to receive submissions:
codestromhub@gmail.comandarvincia@sparrow-group.com - Copy the Access Key (looks like:
abc123def-4567-89ab-cdef-0123456789ab)
- ✅ Unlimited form submissions
- ✅ Email notifications
- ✅ Spam protection with reCAPTCHA
- ✅ File uploads (up to 5MB)
- ✅ Custom email templates
- ✅ No branding required
- Go to your repository on GitHub
- Click Settings → Pages
- Under "Source", select GitHub Actions
- Click Save
- In your repository, go to Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
WEB3FORMS_ACCESS_KEY - Value: Paste your Web3Forms access key from Step 1
- Click Add secret
- Go to Settings → Actions → General
- Scroll to "Workflow permissions"
- Select Read and write permissions
- Check Allow GitHub Actions to create and approve pull requests
- Click Save
The website automatically deploys when you push to the main branch:
# Make any changes to your code
git add .
git commit -m "Update website content"
git push origin mainThe GitHub Actions workflow will:
- ✅ Install dependencies
- ✅ Generate Prisma client
- ✅ Create environment file with Web3Forms key
- ✅ Build static site (removing API routes and admin pages)
- ✅ Export to
outdirectory - ✅ Deploy to GitHub Pages
You can also trigger deployment manually:
- Go to Actions tab in your repository
- Select "Deploy Next.js site to Pages" workflow
- Click Run workflow
- Select
mainbranch - Click Run workflow button
- Go to Actions tab
- Click on the latest workflow run
- Monitor the build and deploy jobs
- Check for any errors (shown in red)
- Expected duration: 2-4 minutes
- Steps: Install dependencies → Build → Deploy
Build Failed
- Check that all dependencies are in
package.json - Verify
WEB3FORMS_ACCESS_KEYsecret is set - Review error logs in Actions tab
Deployment Failed
- Ensure GitHub Pages is enabled
- Check workflow permissions are set correctly
- Verify Pages source is "GitHub Actions"
After successful deployment, your website will be available at:
https://<username>.github.io/<repository-name>/
Example:
https://codestorm-hub.github.io/Sharothee-Wedding-arvinwedsincia/
- Initial deployment: 2-5 minutes
- Subsequent deployments: 30-60 seconds
- Cache clearing: May take up to 10 minutes
If you don't see changes:
- Press
Ctrl + Shift + R(Windows/Linux) - Press
Cmd + Shift + R(Mac) - Or open in incognito/private mode
- Go to
/contactpage - Fill out the form:
- Name: Test User
- Email: your-email@example.com
- Subject: General Questions
- Message: This is a test message
- Click "Send Message"
- You should see: "Thank You! Please send your message directly to our email..."
- Go to
/rsvppage - Fill out the form:
- Full Name: Test Guest
- Will attend: Yes
- Family: Bride's Family
- Guest count: 2
- Email: your-email@example.com
- Click "Submit RSVP"
- You should see: "Thank You! Your RSVP has been received..."
- Check the email addresses configured in Web3Forms
- Should receive notification with form details
- Verify submitter's email is included in the message
- Visit homepage (
/) - Verify love story images load correctly
- Go to
/gallerypage - Confirm all gallery images display
- Check
/eventspage event images - Test on mobile devices
All images are served unoptimized from the static export:
- Located in:
public/images/ - Served from:
out/images/ - Format: Original (JPEG, PNG)
- Homepage loads with hero section
- Navigation menu works on all pages
- Footer displays correctly
- All links are working
- Images load properly
- Contact form submits successfully
- RSVP form submits successfully
- Form validation works (required fields)
- Success messages display
- Email notifications received
- Mobile view (320px - 480px)
- Tablet view (481px - 768px)
- Desktop view (769px+)
- Touch targets are at least 48x48px
- Pages load in under 3 seconds
- Images are optimized for web
- No console errors in browser
Issue: Form shows error message
Solutions:
- Verify
WEB3FORMS_ACCESS_KEYsecret is set correctly - Check Web3Forms dashboard for any issues
- Ensure email addresses in
serverless-forms.tsare correct - Test with a different email address
Check Code:
// client/src/lib/serverless-forms.ts
const accessKey = process.env.NEXT_PUBLIC_WEB3FORMS_KEY || 'YOUR_WEB3FORMS_ACCESS_KEY_HERE';Issue: Images show broken icon
Solutions:
- Verify images exist in
client/public/images/ - Check image paths in code (should be
/images/...) - Ensure
basePathis configured correctly innext.config.ts - Check browser console for 404 errors
Image Path Example:
// Correct for GitHub Pages
<img src="/Sharothee-Wedding-arvinwedsincia/images/gallery/photo.jpg" />
// Better approach (Next.js handles basePath)
<img src="/images/gallery/photo.jpg" />Issue: Pages return 404
Solutions:
- Ensure
.nojekyllfile exists inoutdirectory - Check that basePath is set in
next.config.ts - Verify GitHub Pages source is "GitHub Actions"
- Wait 2-3 minutes for deployment to propagate
Issue: Workflow fails during build
Solutions:
- Check Node.js version (should be 20+)
- Verify all dependencies are installed
- Run build locally:
npm run build:static - Check for TypeScript errors:
npm run type-check - Review workflow logs in Actions tab
Edit client/src/lib/serverless-forms.ts:
// Line 154-161
formData.append('email', 'your-primary-email@example.com');
formData.append('from_email', 'your-primary-email@example.com');
formData.append('cc', 'your-secondary-email@example.com');- Log in to Web3Forms dashboard
- Click on your form
- Update settings:
- Email recipients: Add/remove email addresses
- Email template: Customize notification format
- Success page: Set custom redirect URL
- reCAPTCHA: Enable spam protection
Edit .github/workflows/nextjs.yml:
on:
# Deploy on push to main
push:
branches: ["main"]
# Deploy on pull request to main
pull_request:
branches: ["main"]
# Manual deployment
workflow_dispatch:To use a custom domain:
-
Add
CNAMEfile toclient/public/:yourdomain.com -
Update DNS records:
Type: CNAME Name: www Value: <username>.github.io -
Configure in GitHub:
- Go to Settings → Pages
- Enter custom domain
- Enable "Enforce HTTPS"
-
Update
next.config.ts:const basePath = isGitHubPages ? '' : '';
Add Google Analytics to client/src/app/layout.tsx:
import Script from 'next/script'
export default function RootLayout({ children }) {
return (
<html>
<head>
<Script
src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"
strategy="afterInteractive"
/>
<Script id="google-analytics" strategy="afterInteractive">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
`}
</Script>
</head>
<body>{children}</body>
</html>
)
}- Email: codestromhub@gmail.com
- GitHub Issues: Create an issue in the repository
- Documentation: See
GITHUB_PAGES_DEPLOYMENT.mdfor more details
- Web3Forms Documentation: https://docs.web3forms.com
- Next.js Static Export: https://nextjs.org/docs/app/building-your-application/deploying/static-exports
- GitHub Pages: https://docs.github.com/pages
- GitHub Actions: https://docs.github.com/actions
If you've completed all steps, your wedding website should be:
✅ Live on GitHub Pages ✅ Forms working with email notifications ✅ Images loading correctly ✅ Mobile responsive ✅ Ready for guests to RSVP!
Congratulations on deploying your wedding website! 💍✨