Knowledgebase

How to Set Up Automatic Git Deployment via Webhooks Print

  • 0

Push code to GitHub and automatically pull and rebuild on your VPS.

Step-by-Step Instructions

  1. Generate a deploy SSH key on the VPS and add it to GitHub Deploy Keys.
  2. Create a deploy.sh script that runs git pull, build, and pm2 reload.
  3. Trigger deploy.sh from GitHub Actions via SSH.
git pull origin main && npm ci && npm run build && pm2 reload all

Pro Tip: Keep a backup of the previous build artifact for instant rollbacks.

Need assistance? Open a ticket in the A1 Client Area or contact our 24/7 NOC Engineering Team on WhatsApp at +1 (406) 229-9597.


Was this answer helpful?

« Back