Forem

Cover image for A dependency to deploy Next apps to GitHub Pages ⚡
Welcoming Sloth
Welcoming Sloth

Posted on

1

A dependency to deploy Next apps to GitHub Pages ⚡

Recently I made a small tool named neght, heavily inspired by storybook-deployer, to help developers deploy their static Next.js apps to GitHub Pages.

Preview

What is Neght 💭

Neght is a tool / dependency you can add to your project to easily deploy it to GitHub Pages. It builds the project in a way that's compatible with GitHub Pages and then pushes it to a designated branch.

How it works 👩‍🔧

First, configure your Next app to be static site, which consists of adding output: 'export' to your next config.

Then, add neght as a dependency (yarn add neght).

Finally, add neght as a script to your package.json.

"scripts": {
  "build": "next build",
  "deploy": "neght --script build --branch gh-pages"
}
Enter fullscreen mode Exit fullscreen mode

That's it! Now when you run the deploy script neght will take care of building your Next project and pushing it to gh-pages branch of your repository.

All that remains for you to do is to make sure that GitHub serves the gh-pages branch through GitHub Pages and you're all done.

Links 🔗

GitHub: https://github.com/Tomburgs/neght
npm: https://www.npmjs.com/package/neght

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (1)

Collapse
 
no2ehi profile image
Ruholah

thanks man.

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay