A starter project for Next.js, Netlify and Github Actions
This is a Next.js project bootstrapped with create-next-app
and set up to be deployed on Netlify using Github Actions.
This template is related to the article: How to deploy your Next.js app on Netlify using Github Actions
Install the dependencies
npm install
Check your project is working properly launching the dev mode:
npm run dev
A new tab should automatically open in your browser.
If not, go to http://localhost:3000 with your browser to see the result.
Go to your Github project settings and setup the following environment variables.
Actions secret name | Comments |
---|---|
NETLIFY_AUTH_TOKEN |
Request your token here |
NETLIFY_SITE_ID |
The site to where deploy your site (get it from the API ID on your Site Settings) |
The current Github Action only works when you open a new PR to main / master. Feel free to change to push
instead of pull_request
if you want to trigger on push.
You can use this button below to create a new repo with the current project and automatically deploy to Netlify.