This guide covers various deployment options for the Cloud Tech website.
./deploy.shnpm install
npm run build
npm run export- Push code to GitHub
- Connect repository to Vercel
- Deploy automatically
- Custom domain setup available
Pros: Zero configuration, automatic deployments, great performance Cons: None for static sites
- Build:
npm run build && npm run export - Upload
out/folder to Netlify - Configure redirects in
netlify.tomlif needed
Pros: Easy drag-and-drop deployment, form handling Cons: Build time limits on free plan
- Build the project locally
- Push
out/contents togh-pagesbranch - Enable GitHub Pages in repository settings
Pros: Free hosting, integrated with GitHub Cons: Static sites only, limited features
- Build the project:
npm run build && npm run export - Upload
out/contents to S3 bucket - Configure CloudFront distribution
- Set up custom domain
Pros: Highly scalable, CDN included, cost-effective Cons: More complex setup
- Build:
npm run build && npm run export - Upload
out/folder contents via FTP/SFTP - Configure web server (Apache/Nginx)
Pros: Full control, works with any hosting provider Cons: Manual deployment process
Create .env.local for production:
NEXT_PUBLIC_SITE_URL=https://your-domain.com
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=G-XXXXXXXXXX- Update
NEXT_PUBLIC_SITE_URLin environment variables - Configure DNS records
- Set up SSL certificate
For optimal performance, configure your CDN to:
- Cache static assets (JS, CSS, images) for 1 year
- Cache HTML files for 1 hour
- Enable gzip compression
- Set proper cache headers
npm run buildnpm run exportnpm install -g @next/bundle-analyzer
ANALYZE=true npm run build- Monitor LCP (Largest Contentful Paint)
- Track FID (First Input Delay)
- Measure CLS (Cumulative Layout Shift)
- Google PageSpeed Insights
- Lighthouse
- WebPageTest
- GTmetrix
Always use HTTPS in production:
- Obtain SSL certificate
- Configure redirects from HTTP to HTTPS
- Update all internal links to use HTTPS
Configure these headers on your web server:
Content-Security-Policy: default-src 'self'
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Build Fails
- Check Node.js version (18+ required)
- Clear node_modules and reinstall
- Check for TypeScript errors
Images Not Loading
- Verify image paths are correct
- Check Next.js Image configuration
- Ensure images are in public/ directory
Routing Issues
- Configure web server for SPA routing
- Set up proper redirects
- Check basePath configuration
Performance Issues
- Optimize images
- Enable compression
- Configure CDN
- Minimize bundle size
If you encounter issues:
- Check the troubleshooting section
- Review build logs
- Test locally first
- Contact support team
- Add Google Analytics ID to environment variables
- Configure tracking events
- Set up conversion goals
- Monitor user behavior
Consider adding error tracking:
- Sentry
- LogRocket
- Bugsnag
Set up monitoring for:
- Website availability
- Performance metrics
- SSL certificate expiration
- Domain expiration
Need Help? Contact the development team or check the main README for additional support options.