Deployment Guide
GitHub Pages Deployment
This application is configured for automatic deployment to GitHub Pages using GitHub Actions.
Setup Instructions
- Repository Setup
- Push your code to a GitHub repository
- Ensure the main branch contains all your changes
- Enable GitHub Pages
- Go to your repository’s Settings
- Navigate to “Pages” in the left sidebar
- Under “Source”, select “GitHub Actions”
- Configure Repository Permissions
- Go to Settings > Actions > General
- Under “Workflow permissions”, select “Read and write permissions”
- Check “Allow GitHub Actions to create and approve pull requests”
- Deploy
- Push to the main branch or trigger the workflow manually
- The GitHub Action will automatically build and deploy your app
- Your site will be available at:
https://<username>.github.io/<repository-name>
Manual Deployment
You can also deploy manually:
# Build the static export
npm run build
# The generated files will be in the 'out' directory
# Upload the contents of 'out' to your hosting provider
Configuration Details
- Next.js Config: Static export enabled with trailing slashes
- Output Directory:
out/ (configured for GitHub Pages)
- Image Optimization: Disabled for static export compatibility
- No Jekyll:
.nojekyll file prevents Jekyll processing
Troubleshooting
- 404 Errors: Ensure trailing slashes are properly configured
- Asset Loading Issues: Check that all paths are relative
- Build Failures: Review the GitHub Actions logs for detailed error messages
Environment Variables
If your app uses environment variables, add them to your repository secrets:
- Go to Settings > Secrets and variables > Actions
- Add your environment variables as repository secrets
- Update the GitHub Actions workflow to use them during build