How to Set Up CI/CD Using Jenkins with GitHub Integration
How to Set Up CI/CD Using Jenkins with GitHub Integration
How to Set Up CI/CD Using Jenkins with GitHub Integration

How to Set Up CI/CD Using Jenkins with GitHub Integration

By:

Vanshika Doshi

14 Jul 2025

In modern backend development, automation is a must. You want every code change to be tested, built, and deployed — without manual steps that slow you down or cause mistakes. This is the promise of CI/CD (Continuous Integration / Continuous Deployment).

In this post, you’ll learn how to:

  • Install Jenkins on Windows

  • Connect Jenkins with GitHub

  • Set up a pipeline (Jenkinsfile)

  • Deploy your backend automatically

What is CI/CD (and Why Jenkins)?

CI/CD

(Img Source)

  • Continuous Integration (CI): Automatically build and test your code when you push changes

  • Continuous Deployment (CD): Automatically deploy after tests pass

Why Jenkins?

  • Open-source and proven

  • Works with any language or tool

  • Huge plugin ecosystem

  • You control where it runs, including your Windows machine

How to Set Up Jenkins on Windows

(Img Source)

  1. Download and install Jenkins

  1. Go to: https://www.jenkins.io/download/ 

  2. Download the Windows installer (.msi)

  3. Run the installer - follow the wizard (accept defaults is fine for most)

Jenkins Installer
  1. Access Jenkins UI

  1. Open browser: http://localhost:8080

  2. Unlock Jenkins: find the password at (C:\Program Files\Jenkins\secrets\initialAdminPassword)

  3. Paste it into the web UI

Access Jenkins UI
  1. Install recommended plugins

  1. Pipeline: Enables defining CI/CD as code via Jenkinsfile. Core for modern CI/CD.

  2. Git plugin: Allows Jenkins to pull from your GitHub repository.

  3. GitHub plugin: Provides GitHub integration (webhooks, commit status reporting, PR builds).

  4. SSH Agent: Lets Jenkins handle SSH keys securely, needed for GitHub access or server deployment.

  5. Credentials Binding: Helps securely inject API tokens, SSH keys, passwords into your builds.

  6. NodeJS plugin (if using Node.js): Manage Node.js versions for build/test steps.

  7. PowerShell plugin: Run PowerShell commands/scripts directly in your pipeline (essential for Windows).

  8. Publish Over SSH (optional): Transfer files / execute commands on remote servers over SSH.

  9. AnsiColor plugin: Makes console logs more readable by adding color support.

  10. Email Extension plugin (optional): Send detailed build status notifications.

  11. Timestamper plugin (optional): Adds timestamps to console output, helpful for debugging long builds.

You can always add plugins later via Manage Jenkins > Manage Plugins > Available tab

Jenkins Plugins
  1. Create admin user

  1. Navigate to the Manage Jenkins page from the Jenkins dashboard.

  2. Select Users under the Security section.

  3. Select create user and fill the details.

Create user in Jenkins

Connect Jenkins to GitHub

  1. Generate SSH key on Windows (for Jenkins)

  1. Use Git Bash or PowerShell: ssh-keygen -t rsa -b 4096 -C jenkins@yourdomain.com

  2. You'll be prompted to enter a file in which to save the key. You can accept the default or specify a different location.

  3. You can optionally set a passphrase for added security, but this is not required.

  4. This will generate two files: id_rsa (private key) and id_rsa.pub (public key).

  1. Add the public key to GitHub deploy keys

  1. GitHub > Your repo > Settings > Deploy keys > Add deploy key

    Adding public keys to GitHub deploy keys


  2. Name it Jenkins 

  3. Paste the content of id_rsa.pub 

  4. Allow write access (if Jenkins will push)

  1. Add private key in Jenkins credentials

  1. Jenkins > Manage Jenkins > Credentials > Global > Add Credentials

    Adding Private key in Jenkins credentials


  2. Kind: SSHUsername with private key

  3. Username: git 

  4. Private key: paste or load from file

  1. Set up GitHub webhook for automatic builds

  1. GitHub > Your repo > Settings > Webhooks > Add webhook

  2. Payload URL: http://YOUR-PC-IP:8080/github-webhook/ 

    Setting up GitHub webhook for automatic builds



  3. Content type: application/json 

  4. Event: Push events

  5. In Jenkins pipeline job > Build Triggers > GitHub hook trigger for GITScm polling

Setting up GitHub webhook for automatic builds

Create Jenkins Pipeline Job

  • Jenkins dashboard > New Item > Pipeline

    Create Jenkins Pipeline job


  • Pipeline script from SCM > Git

  • Repository: git@github.com:YOUR-USERNAME/YOUR-REPO.git

  • Credentials: select your SSH credential you added earlier

  • Branch: */main (or your branch)

    Create Jenkins Pipeline job

Example Jenkinsfile

pipeline { 
  agent any 
  stages { 
    stage('Checkout') { 
      steps { 
        git branch: 'main', url: 'git@github.com:YOUR-USERNAME/YOUR-REPO.git' 
      } 
    } 
    stage('Install Dependencies') { 
      steps { 
        bat 'npm ci' 
      } 
    } 
    stage('Run Tests') { 
      steps { 
        bat 'npm test' 
      } 
    } 
    stage('Deploy') { 
      when { 
        branch 'main' 
      } 
      steps { 
        bat 'echo Deploy step: Copy files to server or trigger deployment script' 
      } 
    } 
  } 
  post { 
    success { 
      echo 'Pipeline succeeded.' 
    } 
    failure { 
      echo 'Pipeline failed.' 
    } 
  } 
}

Deployment on Windows

  • Copy files to another server using xcopy, robocopy, or WinSCP

  • Use PowerShell scripts for remote deploy

  • Use Docker if installed

Reference Links

Final Thoughts

By setting up Jenkins on Windows and connecting it with GitHub:

  • Your backend builds and tests automatically on every push

  • You reduce manual deployment work

  • You’re ready to add more automation (Docker, Kubernetes, cloud deploys)

Frequently Asked Questions

1. What is Jenkins used for in CI/CD?

A. Jenkins is an open-source automation tool used in CI/CD pipelines to build, test, and deploy code automatically whenever changes are pushed to the repository. It helps developers deliver faster and with fewer errors.

2. How do I install Jenkins on Windows?

A. To install Jenkins on Windows, download the .msi installer from jenkins.io, run the setup wizard, unlock Jenkins using the initial admin password, and install the recommended plugins.

3. How do I connect Jenkins to GitHub?

A. You can connect Jenkins to GitHub by adding an SSH deploy key to your GitHub repo, saving the private key in Jenkins credentials, and configuring a webhook in GitHub to trigger Jenkins builds on push events.

In modern backend development, automation is a must. You want every code change to be tested, built, and deployed — without manual steps that slow you down or cause mistakes. This is the promise of CI/CD (Continuous Integration / Continuous Deployment).

In this post, you’ll learn how to:

  • Install Jenkins on Windows

  • Connect Jenkins with GitHub

  • Set up a pipeline (Jenkinsfile)

  • Deploy your backend automatically

What is CI/CD (and Why Jenkins)?

CI/CD

(Img Source)

  • Continuous Integration (CI): Automatically build and test your code when you push changes

  • Continuous Deployment (CD): Automatically deploy after tests pass

Why Jenkins?

  • Open-source and proven

  • Works with any language or tool

  • Huge plugin ecosystem

  • You control where it runs, including your Windows machine

How to Set Up Jenkins on Windows

(Img Source)

  1. Download and install Jenkins

  1. Go to: https://www.jenkins.io/download/ 

  2. Download the Windows installer (.msi)

  3. Run the installer - follow the wizard (accept defaults is fine for most)

Jenkins Installer
  1. Access Jenkins UI

  1. Open browser: http://localhost:8080

  2. Unlock Jenkins: find the password at (C:\Program Files\Jenkins\secrets\initialAdminPassword)

  3. Paste it into the web UI

Access Jenkins UI
  1. Install recommended plugins

  1. Pipeline: Enables defining CI/CD as code via Jenkinsfile. Core for modern CI/CD.

  2. Git plugin: Allows Jenkins to pull from your GitHub repository.

  3. GitHub plugin: Provides GitHub integration (webhooks, commit status reporting, PR builds).

  4. SSH Agent: Lets Jenkins handle SSH keys securely, needed for GitHub access or server deployment.

  5. Credentials Binding: Helps securely inject API tokens, SSH keys, passwords into your builds.

  6. NodeJS plugin (if using Node.js): Manage Node.js versions for build/test steps.

  7. PowerShell plugin: Run PowerShell commands/scripts directly in your pipeline (essential for Windows).

  8. Publish Over SSH (optional): Transfer files / execute commands on remote servers over SSH.

  9. AnsiColor plugin: Makes console logs more readable by adding color support.

  10. Email Extension plugin (optional): Send detailed build status notifications.

  11. Timestamper plugin (optional): Adds timestamps to console output, helpful for debugging long builds.

You can always add plugins later via Manage Jenkins > Manage Plugins > Available tab

Jenkins Plugins
  1. Create admin user

  1. Navigate to the Manage Jenkins page from the Jenkins dashboard.

  2. Select Users under the Security section.

  3. Select create user and fill the details.

Create user in Jenkins

Connect Jenkins to GitHub

  1. Generate SSH key on Windows (for Jenkins)

  1. Use Git Bash or PowerShell: ssh-keygen -t rsa -b 4096 -C jenkins@yourdomain.com

  2. You'll be prompted to enter a file in which to save the key. You can accept the default or specify a different location.

  3. You can optionally set a passphrase for added security, but this is not required.

  4. This will generate two files: id_rsa (private key) and id_rsa.pub (public key).

  1. Add the public key to GitHub deploy keys

  1. GitHub > Your repo > Settings > Deploy keys > Add deploy key

    Adding public keys to GitHub deploy keys


  2. Name it Jenkins 

  3. Paste the content of id_rsa.pub 

  4. Allow write access (if Jenkins will push)

  1. Add private key in Jenkins credentials

  1. Jenkins > Manage Jenkins > Credentials > Global > Add Credentials

    Adding Private key in Jenkins credentials


  2. Kind: SSHUsername with private key

  3. Username: git 

  4. Private key: paste or load from file

  1. Set up GitHub webhook for automatic builds

  1. GitHub > Your repo > Settings > Webhooks > Add webhook

  2. Payload URL: http://YOUR-PC-IP:8080/github-webhook/ 

    Setting up GitHub webhook for automatic builds



  3. Content type: application/json 

  4. Event: Push events

  5. In Jenkins pipeline job > Build Triggers > GitHub hook trigger for GITScm polling

Setting up GitHub webhook for automatic builds

Create Jenkins Pipeline Job

  • Jenkins dashboard > New Item > Pipeline

    Create Jenkins Pipeline job


  • Pipeline script from SCM > Git

  • Repository: git@github.com:YOUR-USERNAME/YOUR-REPO.git

  • Credentials: select your SSH credential you added earlier

  • Branch: */main (or your branch)

    Create Jenkins Pipeline job

Example Jenkinsfile

pipeline { 
  agent any 
  stages { 
    stage('Checkout') { 
      steps { 
        git branch: 'main', url: 'git@github.com:YOUR-USERNAME/YOUR-REPO.git' 
      } 
    } 
    stage('Install Dependencies') { 
      steps { 
        bat 'npm ci' 
      } 
    } 
    stage('Run Tests') { 
      steps { 
        bat 'npm test' 
      } 
    } 
    stage('Deploy') { 
      when { 
        branch 'main' 
      } 
      steps { 
        bat 'echo Deploy step: Copy files to server or trigger deployment script' 
      } 
    } 
  } 
  post { 
    success { 
      echo 'Pipeline succeeded.' 
    } 
    failure { 
      echo 'Pipeline failed.' 
    } 
  } 
}

Deployment on Windows

  • Copy files to another server using xcopy, robocopy, or WinSCP

  • Use PowerShell scripts for remote deploy

  • Use Docker if installed

Reference Links

Final Thoughts

By setting up Jenkins on Windows and connecting it with GitHub:

  • Your backend builds and tests automatically on every push

  • You reduce manual deployment work

  • You’re ready to add more automation (Docker, Kubernetes, cloud deploys)

Frequently Asked Questions

1. What is Jenkins used for in CI/CD?

A. Jenkins is an open-source automation tool used in CI/CD pipelines to build, test, and deploy code automatically whenever changes are pushed to the repository. It helps developers deliver faster and with fewer errors.

2. How do I install Jenkins on Windows?

A. To install Jenkins on Windows, download the .msi installer from jenkins.io, run the setup wizard, unlock Jenkins using the initial admin password, and install the recommended plugins.

3. How do I connect Jenkins to GitHub?

A. You can connect Jenkins to GitHub by adding an SSH deploy key to your GitHub repo, saving the private key in Jenkins credentials, and configuring a webhook in GitHub to trigger Jenkins builds on push events.

In modern backend development, automation is a must. You want every code change to be tested, built, and deployed — without manual steps that slow you down or cause mistakes. This is the promise of CI/CD (Continuous Integration / Continuous Deployment).

In this post, you’ll learn how to:

  • Install Jenkins on Windows

  • Connect Jenkins with GitHub

  • Set up a pipeline (Jenkinsfile)

  • Deploy your backend automatically

What is CI/CD (and Why Jenkins)?

CI/CD

(Img Source)

  • Continuous Integration (CI): Automatically build and test your code when you push changes

  • Continuous Deployment (CD): Automatically deploy after tests pass

Why Jenkins?

  • Open-source and proven

  • Works with any language or tool

  • Huge plugin ecosystem

  • You control where it runs, including your Windows machine

How to Set Up Jenkins on Windows

(Img Source)

  1. Download and install Jenkins

  1. Go to: https://www.jenkins.io/download/ 

  2. Download the Windows installer (.msi)

  3. Run the installer - follow the wizard (accept defaults is fine for most)

Jenkins Installer
  1. Access Jenkins UI

  1. Open browser: http://localhost:8080

  2. Unlock Jenkins: find the password at (C:\Program Files\Jenkins\secrets\initialAdminPassword)

  3. Paste it into the web UI

Access Jenkins UI
  1. Install recommended plugins

  1. Pipeline: Enables defining CI/CD as code via Jenkinsfile. Core for modern CI/CD.

  2. Git plugin: Allows Jenkins to pull from your GitHub repository.

  3. GitHub plugin: Provides GitHub integration (webhooks, commit status reporting, PR builds).

  4. SSH Agent: Lets Jenkins handle SSH keys securely, needed for GitHub access or server deployment.

  5. Credentials Binding: Helps securely inject API tokens, SSH keys, passwords into your builds.

  6. NodeJS plugin (if using Node.js): Manage Node.js versions for build/test steps.

  7. PowerShell plugin: Run PowerShell commands/scripts directly in your pipeline (essential for Windows).

  8. Publish Over SSH (optional): Transfer files / execute commands on remote servers over SSH.

  9. AnsiColor plugin: Makes console logs more readable by adding color support.

  10. Email Extension plugin (optional): Send detailed build status notifications.

  11. Timestamper plugin (optional): Adds timestamps to console output, helpful for debugging long builds.

You can always add plugins later via Manage Jenkins > Manage Plugins > Available tab

Jenkins Plugins
  1. Create admin user

  1. Navigate to the Manage Jenkins page from the Jenkins dashboard.

  2. Select Users under the Security section.

  3. Select create user and fill the details.

Create user in Jenkins

Connect Jenkins to GitHub

  1. Generate SSH key on Windows (for Jenkins)

  1. Use Git Bash or PowerShell: ssh-keygen -t rsa -b 4096 -C jenkins@yourdomain.com

  2. You'll be prompted to enter a file in which to save the key. You can accept the default or specify a different location.

  3. You can optionally set a passphrase for added security, but this is not required.

  4. This will generate two files: id_rsa (private key) and id_rsa.pub (public key).

  1. Add the public key to GitHub deploy keys

  1. GitHub > Your repo > Settings > Deploy keys > Add deploy key

    Adding public keys to GitHub deploy keys


  2. Name it Jenkins 

  3. Paste the content of id_rsa.pub 

  4. Allow write access (if Jenkins will push)

  1. Add private key in Jenkins credentials

  1. Jenkins > Manage Jenkins > Credentials > Global > Add Credentials

    Adding Private key in Jenkins credentials


  2. Kind: SSHUsername with private key

  3. Username: git 

  4. Private key: paste or load from file

  1. Set up GitHub webhook for automatic builds

  1. GitHub > Your repo > Settings > Webhooks > Add webhook

  2. Payload URL: http://YOUR-PC-IP:8080/github-webhook/ 

    Setting up GitHub webhook for automatic builds



  3. Content type: application/json 

  4. Event: Push events

  5. In Jenkins pipeline job > Build Triggers > GitHub hook trigger for GITScm polling

Setting up GitHub webhook for automatic builds

Create Jenkins Pipeline Job

  • Jenkins dashboard > New Item > Pipeline

    Create Jenkins Pipeline job


  • Pipeline script from SCM > Git

  • Repository: git@github.com:YOUR-USERNAME/YOUR-REPO.git

  • Credentials: select your SSH credential you added earlier

  • Branch: */main (or your branch)

    Create Jenkins Pipeline job

Example Jenkinsfile

pipeline { 
  agent any 
  stages { 
    stage('Checkout') { 
      steps { 
        git branch: 'main', url: 'git@github.com:YOUR-USERNAME/YOUR-REPO.git' 
      } 
    } 
    stage('Install Dependencies') { 
      steps { 
        bat 'npm ci' 
      } 
    } 
    stage('Run Tests') { 
      steps { 
        bat 'npm test' 
      } 
    } 
    stage('Deploy') { 
      when { 
        branch 'main' 
      } 
      steps { 
        bat 'echo Deploy step: Copy files to server or trigger deployment script' 
      } 
    } 
  } 
  post { 
    success { 
      echo 'Pipeline succeeded.' 
    } 
    failure { 
      echo 'Pipeline failed.' 
    } 
  } 
}

Deployment on Windows

  • Copy files to another server using xcopy, robocopy, or WinSCP

  • Use PowerShell scripts for remote deploy

  • Use Docker if installed

Reference Links

Final Thoughts

By setting up Jenkins on Windows and connecting it with GitHub:

  • Your backend builds and tests automatically on every push

  • You reduce manual deployment work

  • You’re ready to add more automation (Docker, Kubernetes, cloud deploys)

Frequently Asked Questions

1. What is Jenkins used for in CI/CD?

A. Jenkins is an open-source automation tool used in CI/CD pipelines to build, test, and deploy code automatically whenever changes are pushed to the repository. It helps developers deliver faster and with fewer errors.

2. How do I install Jenkins on Windows?

A. To install Jenkins on Windows, download the .msi installer from jenkins.io, run the setup wizard, unlock Jenkins using the initial admin password, and install the recommended plugins.

3. How do I connect Jenkins to GitHub?

A. You can connect Jenkins to GitHub by adding an SSH deploy key to your GitHub repo, saving the private key in Jenkins credentials, and configuring a webhook in GitHub to trigger Jenkins builds on push events.

Explore other blogs

Explore other blogs

let's get in touch

Have a Project idea?

Connect with us for a free consultation !

Confidentiality with NDA

Understanding the core business.

Brainstorm with our leaders

Daily & Weekly Updates

Super competitive pricing

let's get in touch

Have a Project idea?

Connect with us for a free consultation !

Confidentiality with NDA

Understanding the core business.

Brainstorm with our leaders

Daily & Weekly Updates

Super competitive pricing