Skip to content
Discussion options

You must be logged in to vote

Hello!

You are completely right—because Next.js is a React framework that usually relies on a Node.js server for rendering, it doesn't work out of the box when you just push the code to a static host like GitHub Pages.

You are already on the right track! You just need to tell Next.js to generate static HTML files, and then use GitHub Actions to automate the build and deployment process.

Here is a step-by-step guide to get your site live:

1. Configure Next.js for Static Export

First, you need to tell Next.js to output static files (.html, .css, .js) instead of running a server.

Open your next.config.js (or next.config.mjs) file at the root of your project and add output: 'export'. It shoul…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@javascripter101
Comment options

Answer selected by javascripter101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question Ask and answer questions about GitHub features and usage Workflow Deployment Topics about deploying workflows, publishing artifacts, and deployment targets in GitHub Actions. Workflow Configuration Topics about workflow files, YAML setup, job dependencies, and general workflow configuration issues Welcome 🎉 Used to greet and highlight first-time discussion participants. Welcome to the community! source:ui Discussions created via Community GitHub templates
3 participants