DEV Community

Discussion on: Deploying a Next.js app to GitHub Pages

Collapse
 
nikacodes profile image
Nicole Zonnenberg

Hi James!

Thank you for your prompt reply! And thank you for pointing out the main, it's a new change so I'm still getting used to it. 🤦‍♀️

And it worked! Thank you so much! <3

Thread Thread
 
jameswallis profile image
James Wallis

Good to hear, your website looks great!

Thread Thread
 
nikacodes profile image
Nicole Zonnenberg

Thank you! And one more quick question. For updating the website, would you recommend branching off of master/main and then merging main into gh-pages? Or branching of gh-pages and merging into gh-pages and then main?

Thread Thread
 
jameswallis profile image
James Wallis • Edited

So you should branch off master/main and then merge back into master/main.
Once you've merged your changes, Travis will build and export your Next.js application and then push the new HTML (out directory) onto your gh-pages branch - it uses a force push to completely overwrite the branch.

You shouldn't ever need to touch the gh-pages branch.