Comment on page
Deploy to Vercel
This tutorial will show how to deploy your project to Vercel, using GitHub Actions.
Before you start, you need to have a PostgreSQL database running on the cloud.
It's essential to add the
?pgbouncer=trueat the end, to let Prisma know that it's using a pooler.
Here is an example:
Relate the downloaded codebase to this repository.
Choose to import the project you just created on GitHub.
On Framework Preset, select NextJS.js if it's not by default.
The subsequent deployments will be via GitHub Actions because it allows us to run unit tests and deploy migrations before deploying the application.
- 3.Inside your folder, run
vercel linkto create a new Vercel project
- 4.Inside the generated
.vercelfolder, save the
Go back go GitHub and then go to Settings > Secrets and Variables > Actions and create a few New Repository Secrets.
- VERCEL_ORG_ID - This is the Vercel Organization ID that you just got.
- VERCEL_PROJECT_ID - This is the Vercel Project ID that you just got.
- VERCEL_TOKEN - The Vercel token you just got.
- DATABASE_URL - This should be the connection URL the application will use to connect to the database via bouncer. In our example it would be: postgres://appuser.secret:[email protected]:6543/postgres?pgbouncer=true"
- DATABASE_MIGRATION_URL - This is the connection URL GitHub will use to connect to the database to run the migrations. In our example, this would be: postgresql://postgres:[email protected]:5432/postgres?schema=public.
- DATABASE_APP_PASSWORD - This is the password for the application user. The migration scripts create the application user, so that's why the password is required.
After you push the latest code to the repo, the tests and deployment will be triggered.