> For the complete documentation index, see [llms.txt](https://lakshya-project.gitbook.io/microservice-project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lakshya-project.gitbook.io/microservice-project/continuous-integration-with-github-and-jenkins.md).

# 🏃‍♂️Continuous Integration with GitHub and Jenkins

Every time your developer makes changes to the code in the Github Repository will you login to Jenkins and click "Build Now" all the time??

What if I say we can automate that too? ☺️ Let us do something so that if there is any change in the code **Jenkins** should detect it and Build a new file, pass it to ANSIBLE, which will create our container and move the file in it & BOOM!!! our application is live.

1. Sign into your **GitHub** account and select your repository
2. Go to settings option >> Choose ![](https://nasi-chaudari.gitbook.io/~gitbook/image?url=https:%2F%2F2593464885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F3DMI85ymmo2BqduKTK9p%252Fuploads%252FQyAw823VfEoMDdAR3V7O%252Fimage.png%3Falt=media%26token=6c121d1e-06da-42a3-8762-0b52f3272561\&width=300\&dpr=4\&quality=100\&sign=9887c007bc5d9d833a0e8b77f539577f49ae20235e91aa50c7dd142a115b0eec)>> click on Add Webhook (provide password, if asked)
3. You will be asked to enter the **Payload** URL, you will get this from Jenkins.

   1. Login to Jenkins

      1. Goto pipeline >> Configure
      2. Pipeline Triggers>> copy the formate >> made the required changes&#x20;

      <figure><img src="https://475494772-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7eqNZUv00oKWb5vIK8tA%2Fuploads%2FkuqdGZtJ0HkWgXvuGmTx%2FScreenshot%202024-04-19%20161517.png?alt=media&amp;token=098fafe8-1863-405c-8487-c7032fc562c5" alt=""><figcaption></figcaption></figure>

      1. Add webhook>> Paste the URL

      <figure><img src="https://475494772-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7eqNZUv00oKWb5vIK8tA%2Fuploads%2F5QkxWs65Sa3cP4zYnRnw%2FScreenshot%202024-04-19%20161445.png?alt=media&amp;token=f67ca26d-6413-403f-b51f-aec54d22fbb8" alt=""><figcaption></figcaption></figure>

   After putting the url scroll down and select on

   1. ![](https://nasi-chaudari.gitbook.io/~gitbook/image?url=https:%2F%2F2593464885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F3DMI85ymmo2BqduKTK9p%252Fuploads%252FO6gYz7rqDHx6jOBqZf00%252Fimage.png%3Falt=media%26token=c5b5cdda-e71f-4d4e-ae0e-caf92d4c0ea7\&width=300\&dpr=4\&quality=100\&sign=4a746b37a28b7042e2b0af8e512333e879516b4c3afe123a332bba0f6657aa96)
   2. Add webhook

You have successfully created your webhooks Now go to your Depoyment Job and do these settings

THAT'S ALL!! We have successfully implemented **Continuos Integration** Let's Try it out my making some changes in the code.

[<br>](https://nasi-chaudari.gitbook.io/devops-on-aws/ansible/ansible-playbook)
