Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 44 ยท CI/CD Fundamentals

GitHub Actions, Jenkins and GitLab Compared

Compare GitHub Actions, Jenkins and GitLab CI/CD: hosting, configuration style, vocabulary, strengths and costs, and a simple way to choose between them.

This track teaches three CI/CD tools side by side. They solve the same problem, and a pipeline that builds, tests and deploys a project looks conceptually the same in all of them. But they differ in who runs the servers, how you write the configuration, and how much freedom (and responsibility) you get. Knowing those differences lets you pick a tool on purpose instead of by habit, and move between them without starting over.

In this lesson you will compare the three along the dimensions that matter in practice: hosting, configuration language, vocabulary, ecosystem and cost. At the end you will run a stand-in that translates one neutral pipeline description into the three configuration shapes, which makes the similarities very concrete.

Three tools in one paragraph each

GitHub Actions is built into GitHub. A workflow is a YAML file in .github/workflows/. GitHub provides hosted runners (Linux, Windows, macOS) and lets you add your own. Reusable pieces, called actions, are shared on a marketplace, so many tasks are one uses: line. It is the lowest-friction choice if your code already lives on GitHub.

Jenkins is an open-source automation server that you install and operate yourself. A controller schedules work and agents run it. Pipelines are written in a Jenkinsfile using Groovy-based syntax, and a very large plugin ecosystem connects it to almost anything. It is extremely flexible and works with any Git host, but you own upgrades, security patches, plugin compatibility and capacity.

GitLab CI/CD is part of GitLab. Pipelines are described in .gitlab-ci.yml in the repository root and run on runners you register (GitLab.com also offers shared ones). Because CI is integrated with merge requests, container registry, environments and security scanning in the same product, it feels like one platform rather than separate parts.

Hosted or self-hosted

GitHub Actions Jenkins GitLab CI/CD
Where the control plane runs GitHub's cloud (GitHub Enterprise Server can be self-managed) Your own server GitLab.com, or your own self-managed GitLab
Where jobs run GitHub-hosted runners or your self-hosted runners Your agents only Shared runners or your own runners
Who patches the control plane GitHub (when hosted) You GitLab (SaaS) or you (self-managed)
Pricing model Free allowance, then pay for minutes (hosted runners) Software is free; you pay for servers and people Free tier with compute minutes, then paid plans

The pricing rows are a summary of the shape of each model. Plans and allowances change often, so check each vendor's current pricing page before you decide.

Configuration as YAML or Groovy

GitHub Actions and GitLab describe pipelines as declarative YAML: you state what should happen, and the platform decides how. This is easy to read and validate, but loops and conditionals are limited to what the YAML keywords offer. Jenkins pipelines are Groovy. The declarative style is a restricted, structured form that is easy to learn. The scripted style is a full programming language, which can express anything but can also become hard to maintain.

Here is the same tiny job in all three tools. Compare the shapes, not the details.

YAML
# GitHub Actions: .github/workflows/ci.yml
name: ci
on:
  push:
    branches: [main]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm test
GROOVY
// Jenkins: Jenkinsfile
pipeline {
  agent any
  stages {
    stage('test') {
      steps {
        sh 'npm ci'
        sh 'npm test'
      }
    }
  }
}
YAML
# GitLab: .gitlab-ci.yml
test:
  image: node:22
  script:
    - npm ci
    - npm test

Some differences hide in the details. GitHub Actions and Jenkins check out the code through an explicit step or the surrounding setup, while GitLab fetches the repository for you automatically before every job. GitLab uses a container image to define the environment (image), GitHub chooses a machine image by label (runs-on), and Jenkins picks an agent (agent). The block above is read-only: these tools need servers that this website does not have.

The vocabulary map

Concept GitHub Actions Jenkins GitLab CI/CD
Config file .github/workflows/*.yml Jenkinsfile .gitlab-ci.yml
Parallel unit of work job parallel branches of stages job
Sequential grouping job needs stage stage
Machine that runs it runner (runs-on) agent (agent) runner (executor chosen at registration)
Reusable building block action, reusable workflow shared library include, extends, CI/CD components
Secret storage repository / environment secrets credentials store CI/CD variables (masked, protected)
Starting event on: SCM trigger, webhook, triggers pipeline source, rules

An executor is how a GitLab runner runs a job: directly in a shell, in a Docker container, in Kubernetes, and so on. In GitHub and Jenkins this choice is folded into the runner or agent setup.

flowchart LR
    N["Neutral idea:<br/>trigger, jobs, steps, machine"] --> G["GitHub Actions<br/>workflow YAML"]
    N --> J["Jenkins<br/>Jenkinsfile (Groovy)"]
    N --> L["GitLab CI/CD<br/>.gitlab-ci.yml"]

One pipeline idea, three notations. Learn the idea once and you can read all three.

Translating one pipeline into three shapes

The following stand-in is not a real converter. It holds one neutral description of a pipeline and prints a plausible configuration for each tool, following the rules above. Reading the output side by side makes it easy to see which part of the neutral description lands where. In real life, always check generated configuration against the tool's own documentation.

JS One neutral pipeline, three notations

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Notice how the neutral stages list becomes needs: in GitHub, the order of stage(...) blocks in Jenkins and a stages: line in GitLab. The branch filter appears as an on.push.branches entry in GitHub and as a rules condition in GitLab. (A Jenkins multibranch job handles branches differently; a when { branch 'main' } block is the usual tool there.) These are not arbitrary differences: they reflect how each product was designed.

When to choose which

There is no universal winner. These rules of thumb cover most situations:

  • Your code is on GitHub and the team is small or medium: start with GitHub Actions. There is nothing to install and the marketplace saves time.
  • Your code is on GitLab: use GitLab CI/CD. The integration with merge requests, registries and environments is the main reason to use GitLab at all.
  • You need to run on special hardware, behind a strict firewall, with many different repositories and Git hosts, or you already run a Jenkins fleet: Jenkins gives full control, at the price of operating it.
  • You have regulated or air-gapped infrastructure: self-hosted options (Jenkins, self-managed GitLab, GitHub Actions with self-hosted runners) are common.
  • You want to avoid lock-in: keep the real work in scripts (make, npm run, shell) that run anywhere, and keep the CI file as a thin wrapper that calls them.

The last point is worth stressing. A pipeline that consists of fifty lines of YAML, each doing real work, is hard to test and hard to move. A pipeline whose steps call ./scripts/test.sh can be run on a laptop and on any CI system.

The next stand-in turns the rules of thumb into a small recommender. It is deliberately simple; the goal is to make the reasoning explicit.

JS A tiny tool chooser

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which tool requires you to install and operate the control plane yourself?

    Jenkins is software you run on your own server: you manage its updates, plugins and capacity. GitHub and GitLab offer hosted control planes.
  2. 2. What is a GitLab 'executor'?

    A runner is registered with an executor that decides how jobs run: directly in a shell, inside a container, in a Kubernetes pod and so on.
  3. 3. Which two tools describe pipelines as declarative YAML?

    GitHub Actions and GitLab use YAML. Jenkins uses a Groovy-based Jenkinsfile, in either declarative or scripted style.
  4. 4. Why is it a good idea to keep real build logic in scripts such as ./scripts/test.sh and have the CI file call them?

    Thin CI files that call portable scripts are easier to test locally and to move between tools, which reduces lock-in.

Summary

  • GitHub Actions, Jenkins and GitLab CI/CD implement the same ideas: triggers, jobs, steps, machines, artifacts and environments.
  • GitHub Actions and GitLab are YAML-based and have hosted options; Jenkins is a self-operated server with Groovy pipelines and a huge plugin ecosystem.
  • The vocabulary differs (runner vs agent, workflow vs pipeline, action vs shared library), but each term has a clear counterpart in the others.
  • Choose by where your code lives, whether you must self-host and how much operations work your team can take on; check current pricing before deciding.
  • Keep real logic in portable scripts and treat the CI file as a thin wrapper to stay flexible.

Next: YAML for Pipeline Authors