Jenkins GitHub Webhook Integration (CI/CD Automation)

In DevOps, automating your builds saves time and ensures fast feedback. With GitHub webhooks, Jenkins can automatically trigger a build when code is pushed.

This post walks you through how to connect Jenkins and GitHub using webhooks, so your CI/CD pipeline runs without any manual trigger.


๐Ÿ› ๏ธ What You Need

  • A running Jenkins server (local or on a cloud VM like EC2)
  • A GitHub repository
  • Git plugin installed in Jenkins
  • Jenkins accessible from GitHub (via public IP, domain, or ngrok)
  • Port 8080 open on your server

๐Ÿงฐ Step 1: Install Git Plugin in Jenkins

  1. Go to: Jenkins > Manage Jenkins > Plugin Manager
  2. Search for โ€œGit pluginโ€
  3. Install and restart Jenkins

Tip: Keep Jenkins updated to avoid integration issues.


๐Ÿงช Step 2: Create a Jenkins Job

  1. Click New Item > Freestyle project
  2. Name it: github-webhook-demo
  3. Under Source Code Management, select Git
  4. Enter your GitHub repo URL
  5. In Build Triggers, check: rustCopyEditโœ… GitHub hook trigger for GITScm polling
  6. Add a build step โ†’ Execute shell:
echo "Build triggered by GitHub webhook"
  1. Click Save

๐ŸŒ Step 3: Setup GitHub Webhook

  1. Go to your GitHub repository
  2. Navigate to Settings > Webhooks > Add webhook
  3. In Payload URL, use:
http://<your-server-ip>:8080/github-webhook/

If youโ€™re using a reverse proxy or SSL, use HTTPS.

  1. Content Type: application/json
  2. Choose: Just the push event
  3. Click Add webhook

๐Ÿงช Step 4: Test the Integration

Push a small change to your GitHub repo:

git add .
git commit -m "Test webhook"
git push origin main

Go to Jenkins and check if the build was triggered under Build History.

โœ… If you see a triggered job, it worked!


๐Ÿ’ฌ What Are Webhooks?

A webhook is a way for GitHub to notify Jenkins that an event occurred (like a code push). This lets Jenkins act instantly without polling.


๐Ÿ“Œ Real-Life Use Case

Imagine youโ€™re working on a Node.js app. Each time your team pushes new code:

  • Jenkins fetches the code
  • Runs automated tests
  • Builds and deploys the app
  • Sends notification

This is true CI/CD automation powered by GitHub Webhooks + Jenkins.


๐Ÿ”— Internal Links


๐Ÿ”— External Links


๐Ÿ“ธ Suggested Images to Add

Add these screenshots to improve SEO:

  • Jenkins job config screen
  • GitHub webhook setup page
  • Jenkins build console output after trigger

๐Ÿง  Final Thoughts

Integrating GitHub webhooks with Jenkins allows you to trigger jobs automatically. This creates a seamless CI/CD workflow and reduces delays in testing or deployment.

Leave a Comment

Your email address will not be published. Required fields are marked *