Day 24 : Harnessing the Power of GitHub Webhooks with Jenkins for Seamless CI/CD
Today we will implement Node js application using Jenkins and Github webhook.
Let's start.
Step 1: Click on create a job from Jenkin dashboard.

Step 2) Give a name to freestyle Project.and click OK.

Step 3) Give Description of it and select Github Project. You need to provide url of git repo. For this example , I am using this url : https://github.com/patelajay745/node-todo-cicd

Step 4) Select Git in Source Code Management and give url of your repo. Don't forget to enter your branch name.For this project , we have master branch.

Step 5) Now select Github hook trigger for GITScm Polling in Build Triggers options.

Step 6) Now go to your repository setting on GITHUB.

Step 7) Select Webhooks from left side options.

Step 8) Enter http://Your-IP:8080/github-webhook/ in Payload url. Select application/json in content type option. and save it.

After saving if it shows Green right ahead of URL then it is setup successfully.

Step 9) Come back to your Jenkins and Add Build step as below. and save it.

Step 10) Click on Build Now option from left panel and check your console. If it shows Success then Congratulation you have created your CI/CD project using github webhook.

From now on, whenever there is a code change in your GitHub repository, Jenkins will automatically trigger the build process, ensuring that your application stays up-to-date.
That was it for today. If you have any questions/suggestions please comment below.See you in Next Challenge
Happy coding and stay tuned for more exciting challenges!



