DEV Community

Cover image for My side project's deployment pipeline is 8 lines of JSON.
Arka Chakraborty
Arka Chakraborty

Posted on Originally published at lnkd.in

My side project's deployment pipeline is 8 lines of JSON.

My side project's deployment pipeline is 8 lines of JSON.

No CI config. No build scripts. No YAML.


Full screen recording

#github #vercel #cicd #deployment | Arka Chakraborty

My side project's deployment pipeline is 8 lines of JSON. No CI config. No build scripts. No YAML. I connected the GitHub repo to Vercel, added one vercel.json, and now pushing to git is the deploy. ━━━━━━━━━━━━━━━━━━━━ Some things to keep in mind: ➤ You only get 100 deployments a day ➤ Each deployment gets it's own URL ➤ The PROD URL is an alias that points to the URL of the latest PROD deployment. ➤ Easy rollback. A rollback doesn't rebuild or redeploy anything. It just repoints the domain to a previous deployment at the routing layer. Takes seconds. ➤ Vercel offers 2 envs for deployment: Preview & Production ━━━━━━━━━━━━━━━━━━━━ How to deploy? CLI version: ➤ vercel (deploys to preview env) ➤ vercel --prod (do I need to explain?) ━━━━━━━━━━━━━━━━━━━━ Git push version: ➤ git push to master or main → deploys to Vercel Production env ➤ git push to any feature branch → deploys to Vercel Preview env ━━━━━━━━━━━━━━━━━━━━ But since both count towards your daily 100 deployment quota, I have personally disabled deploying to preview env via git push to feature branch, ➤ I deploy to preview branch via "vercel" cli command OR ➤ deploy to Production using "git push origin main" or "vercel --prod" To do that include a small 【vercel.json】script that disables deployment for git push to feature branch, If you need the script, comment or DM me ! #github #vercel #cicd #deployment

favicon linkedin.com

I connected the GitHub repo to Vercel, added one vercel.json, and now pushing to git is the deploy.


Some things to keep in mind

➤ You only get 100 deployments a day

➤ Each deployment gets its own URL

➤ The PROD URL is an alias that points to the URL of the latest PROD deployment.

➤ Easy rollback. A rollback doesn't rebuild or redeploy anything. It just repoints the domain to the URL of the previous deployment at the routing layer. Takes seconds.

➤ Vercel offers 2 envs for deployment:

  • Preview
  • Production

How to deploy?

CLI version

vercel
Enter fullscreen mode Exit fullscreen mode

Deploys to the Preview env.

vercel --prod
Enter fullscreen mode Exit fullscreen mode

Do I need to explain?


Git push version

git push to master or main
        ↓
Vercel Production env
Enter fullscreen mode Exit fullscreen mode
git push to any feature branch
        ↓
Vercel Preview env
Enter fullscreen mode Exit fullscreen mode

But since both count towards your daily 100 deployment quota...

I have personally disabled deploying to the Preview env via git push to feature branch.

Instead:

➤ I deploy to Preview via the vercel CLI command.

vercel
Enter fullscreen mode Exit fullscreen mode

OR

➤ Deploy to Production using:

git push origin main
Enter fullscreen mode Exit fullscreen mode

or:

vercel --prod
Enter fullscreen mode Exit fullscreen mode

How?

Include a small vercel.json configuration that disables deployment for git push to feature branch.

If you need the vercel.json configuration, comment or DM me!

Top comments (0)