Developer Tools

Auto-Deploy to Vercel on Git Push

Trigger Vercel deployments automatically when you push to specific branches, with deployment notifications and rollback capability.

Beginner
5 minutes
Published Feb 4, 2024

Auto-Deploy to Vercel on Git Push

Stop clicking "Deploy" manually. Automate your entire Vercel deployment pipeline.

What You'll Build

An automated deployment workflow:

  • Listens for git pushes to main/staging branches
  • Triggers Vercel deployment
  • Sends deployment status to Telegram
  • Supports instant rollback with a message

Requirements

  • Plugins: Vercel (from Lobstash.ai)
  • Time: 5 minutes
  • Vercel Account: With API token

Setup

1. Install Vercel Plugin

Add the Vercel plugin and authenticate:

Connect Vercel account Project: my-nextjs-app

2. Configure Deployment Rules

When I push to: - main branch → deploy to production - staging branch → deploy to preview Send deployment status to my Telegram after each push.

3. Add Rollback Command

When I say "rollback [project-name]": - Revert to previous successful deployment - Confirm action before executing - Notify me when complete

4. Set Up Pre-Deployment Checks

Before deploying: - Check if build passed - Verify environment variables are set - Ensure domain DNS is configured

Sample Workflow

Push to main:

git push origin main

Agent Response (Telegram):

🚀 Deployment Started Project: my-nextjs-app Branch: main Commit: a3f92b1 "Add new landing page" Building... ⏳

2 minutes later:

✅ Deployment Successful URL: https://my-app.vercel.app Time: 1m 42s Changes live in production [View deployment →](https://vercel.com/...)

Rollback Example

You: "rollback my-nextjs-app"

Agent:

⚠️ Rollback Requested Current: v127 (deployed 3h ago) Rolling back to: v126 (deployed 5h ago) Confirm? Reply YES to proceed.

You: "YES"

Agent:

⏪ Rolling back... ✅ Rollback Complete Now serving: v126 URL: https://my-app.vercel.app Review before redeploying.

Pro Tips

  1. Branch Protection: Set up preview deployments for all PRs
  2. Build Alerts: Get notified only if build fails (reduce noise)
  3. Performance Tracking: Log deployment times and optimize
  4. Multi-Project: Manage deployments for multiple Vercel projects

Automate your deployments → Launch Claws

Ready to try this recipe?

Deploy your Claws agent and start automating in under 2 minutes.

Get Started with Claws

Share this recipe

Recipe Details

Difficulty
Beginner
Time to Setup
5 minutes
Plugins Used
Tags
#deployment#CI/CD#automation#vercel