This is a sample project highlighting how can preview environments be implemented using GitHub Actions, Neon & Vercel.
Getting Started
First, run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
Setup
- Create GitHub repository
- Create Vercel Project
- Create a project in Neon
- Copy values
DATABASE_URL
andDIRECT_DATABASE_URL
to.env.local
- Run
npm run prisma migrate reset
- Run
- Copy values to GitHub
DATABASE_URL
DIRECT_DATABASE_URL
PG_USERNAME
PG_PASSWORD
NEON_API_KEY
- `NEON_PROJECT_ID
VERCEL_TOKEN
- Copy
DATABASE_URL
andDIRECT_DATABASE_URL
values to Vercel's environment - Update Vercel > Settings > Git > Ignored build step > Don't build anything
- Create a branch
dev-<person>
for local development & copy values to.env.local
Migrations
# reset the database and apply all migrations
$ npm run prisma migrate reset
# apply migrations
$ npm run prisma migrate deploy