Chapter 90: GitHub Actions Deep Dive
90.9 Comparison — GitHub Actions vs Jenkins vs GitLab CI
Story (fictional teaching scenario). In a TCS-style client review in Pune, Maria from Berlin asked: "Which CI should we use?" Vikram did not pick a favourite. He asked where the code lived. Code on GitHub? GitHub Actions is built in. Code on GitLab? GitLab CI is built in. Need many plugins, on-prem control and old pipelines? Jenkins (chapters 20–32) still fits. The answer was about the team and the code home, not hype.
Why
Interviewers love this question. Real teams also mix tools, so you must explain the trade-offs clearly.
What
| Topic | GitHub Actions | Jenkins | GitLab CI |
|---|---|---|---|
| Where it lives | Inside GitHub | Your own server | Inside GitLab |
| Pipeline file | .github/workflows/*.yml |
Jenkinsfile (Groovy) |
.gitlab-ci.yml |
| Runners / agents | GitHub-hosted or self-hosted | Agents you run | Shared or your own runners |
| Extending | Marketplace actions | Plugins | Templates and includes |
| Who maintains server | GitHub | You | GitLab (or you, if self-managed) |
| Good when | Code already on GitHub | On-prem, heavy plugin use | Code already on GitLab |
How
- Start from where the code lives.
- List hard needs: on-prem only? special plugins? approvals?
- Count who will maintain the CI server, if any.
- Pick one main tool. Do not run three without a reason.
Example 1: Same "run tests" in three tools
GitHub Actions: jobs.test.steps: - run: npm test
Jenkins: stage('Test') { steps { sh 'npm test' } }
GitLab CI: test: script: - npm test
What it shows: The idea is the same. Only the file format and where it runs change.
Example 2: Approval in each tool
GitHub Actions: environment: production (required reviewers)
Jenkins: input message: 'Deploy to prod?'
GitLab CI: when: manual (plus protected environments)
What it shows: All three can pause for a human. The keyword differs.
Ravindra Bagale's Tip
In interviews, never say one tool is best. Say: it depends on where the code lives and who maintains the server, then give one example.
Interview मध्ये एकच tool best असं कधी बोलू नका. म्हणा: code कुठे आहे आणि server कोण maintain करतो त्यावर अवलंबून. मग एक example द्या.
Interview में कभी मत कहो कि एक tool best है. कहो: code कहाँ है और server कौन maintain करता है उस पर depend करता है. फिर एक example दो.
Quick quiz
Q1. Which CI is built into GitHub?
GitHub Actions.
Q2. What file does Jenkins use?
A Jenkinsfile.
Q3. When might Jenkins still be the right pick?
On-prem control, heavy plugin needs or many existing Jenkins pipelines.
Did you understand? Let us try it once more.