CI/CD with GitHub Actions, Jenkins and GitLab Tutorial
Learn CI/CD with GitHub Actions, Jenkins and GitLab step by step: 44 lessons in 10 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
CI/CD Fundamentals
- What Is CI/CD? Learn what CI/CD means, how continuous integration, delivery and deployment differ, what a pipeline does, and what it costs and saves your team.
- Anatomy of a Pipeline Meet the parts every CI/CD pipeline shares: triggers, jobs, stages, steps, runners, artifacts, environments and the exit codes that decide pass or fail.
- 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.
- YAML for Pipeline Authors Learn the YAML you need for GitHub Actions and GitLab CI: mappings, lists, strings, multi-line scripts, anchors, and the quoting traps that break pipelines.
GitHub Actions Basics
- Your First Workflow Write and understand your first GitHub Actions workflow: where the file lives, name, on, jobs, runs-on, steps, uses versus run, and how to read the run log.
- Triggers: push, pull_request, schedule and More Learn GitHub Actions triggers: branch and path filters, pull_request versus pull_request_target, manual runs with inputs, cron schedules and release events.
- Jobs, Steps and Dependencies Learn how GitHub Actions jobs run in parallel, how needs orders them, and how if, outputs, continue-on-error and timeout-minutes control a workflow.
- Expressions and Contexts Master the ${{ }} syntax in GitHub Actions: the github, env, vars, secrets, matrix and needs contexts, built-in functions and status checks like always().
- Matrix Builds Run one job across many operating systems and versions with a GitHub Actions matrix. Learn include, exclude, fail-fast, max-parallel and fromJSON.
- Caching and Artifacts Speed up workflows with actions/cache keys and restore-keys, setup-* caching and hashFiles, and pass build output between jobs with upload and download artifacts.
- Secrets, Variables and Environment Variables Understand env at workflow, job and step level, repository variables versus encrypted secrets, log masking, GITHUB_TOKEN permissions and fork behavior.
GitHub Actions in Practice
- CI for Node and Python Projects Build a complete CI workflow for Node.js and Python: checkout, setup actions, cached installs, lint, tests, coverage upload, version matrices and concurrency.
- CI for Java, Go and PHP Projects Build and test Java, Go and PHP projects in GitHub Actions: setup actions, dependency caching, test reports and a database service container for integration tests.
- Building and Pushing Docker Images Build, tag and push container images from GitHub Actions with Buildx, docker/build-push-action, GHCR login, layer caching and multi-platform builds.
- Reusable Workflows and Composite Actions Stop copying YAML between repositories: write reusable workflows with workflow_call and composite actions, pass inputs, secrets and outputs, and version them safely.
- Environments, Approvals and Deployments Protect deployments with GitHub environments: required reviewers, environment secrets, branch rules, OIDC cloud login without stored keys, and deploy concurrency.
- Self-Hosted Runners and Runner Costs Learn how runner labels and groups route jobs, when to use self-hosted or larger runners, how ephemeral runners stay safe, and how billing minutes add up.
Jenkins
- Jenkins: Controller, Agents and Jobs Meet Jenkins: how the controller and agents work, how to run it in Docker, what plugins and credentials do, and how freestyle jobs differ from pipelines.
- The Declarative Jenkinsfile Write a declarative Jenkinsfile: pipeline, agent, stages, steps, environment, options, post conditions, when and parameters, with a runnable model of the flow.
- Scripted Pipelines and Shared Libraries Learn scripted Jenkins pipelines in Groovy: node, parallel, try/catch/finally, then share code with a library (vars/, src/, @Library) and avoid CPS pitfalls.
- Agents, Docker Agents and Credentials Choose Jenkins agents by label or Docker image, store secrets in the credentials store, use withCredentials safely, and trigger builds with webhooks, not polling.
GitLab CI/CD
- GitLab CI/CD Basics Learn GitLab CI/CD from scratch: the .gitlab-ci.yml file, stages, jobs, script, image, variables, rules, runners and executors, and how to read the pipeline view.
- Rules, needs, Artifacts and Cache Control GitLab CI jobs with rules and workflow:rules, speed pipelines up with the needs DAG, pass files with artifacts and reports, and reuse dependencies with cache.
- Includes, Templates and Environments Reuse GitLab CI configuration with include, extends, !reference and hidden jobs, then track deployments with environments, review apps, manual jobs and protected variables.
Testing and Quality Gates
- Test Stages in a Pipeline Decide where unit, integration and end-to-end tests belong in a CI/CD pipeline, get fast feedback, handle flaky tests and publish test reports.
- Linting, Coverage and Quality Gates Add linters, formatters, coverage thresholds, required status checks, branch protection and CODEOWNERS to turn CI results into rules that block bad merges.
- Securing Your Pipeline Harden GitHub Actions pipelines: least-privilege tokens, pinned actions, script injection, pull_request_target risks, secret scanning, SBOMs and signing.
Releases and Deployment
- Versioning and Automated Releases Use semantic versioning, conventional commits, tags, changelogs and GitHub Releases to automate releases, plus how release branches fit in.
- Deployment Strategies Compare recreate, rolling, blue-green and canary deployments, feature flags, rollbacks, expand/contract database migrations and smoke tests in CI/CD.
- Deploying to Servers, Containers and Static Hosting Deploy from a pipeline to a server over SSH, a container host, GitHub Pages or Kubernetes, authenticate to clouds with OIDC and meet the GitOps idea.
- Infrastructure as Code in Pipelines Run Terraform safely from CI: fmt, validate and plan on pull requests, apply on merge, state locking, plan comments and scheduled drift detection.
Performance and Operations
- Making Pipelines Fast Speed up CI/CD pipelines with caching, parallel jobs, test sharding, path filters, shallow clones, small images and critical path analysis.
- CI for Monorepos Run CI only for what changed in a monorepo: path filters, affected-package detection, dynamic matrices, per-package versions and GitLab child pipelines.
- Debugging Failing Pipelines Find out why a CI pipeline fails: read logs from the first error, turn on debug logging, reproduce runs locally and fix the most common failure causes.
- Pipeline Metrics and Maintenance Measure delivery with the four DORA metrics, track flaky tests and runner cost, send pipeline notifications to chat and automate updates with Dependabot.
Projects
- Project: CI for a Node.js Library Build a complete CI pipeline for a Node.js library: lint, test matrix, coverage gate, build, publish to npm on a version tag and required status checks.
- Project: Build, Scan and Deploy a Container Build a pipeline that tests, builds and scans a Docker image, pushes it by commit SHA, deploys to staging, waits for approval and promotes to production.
- Project: A Jenkins Multibranch Pipeline Build a Jenkins multibranch pipeline step by step: a Jenkinsfile with build, test and package stages, branch rules, parallel checks and post notifications.
- Project: A GitLab Pipeline with Review Apps Build a GitLab CI/CD pipeline with stages, includes, merge request pipelines, review environments, a manual production deploy and cleanup when a branch is gone.
- Project: Release Automation for a Monorepo Automate releases in a monorepo: read conventional commits, bump per-package versions, write changelogs, create tags, and publish only the packages that changed.
Practice and Review
- Practice: Pipeline Exercises with Solutions Test your CI/CD skills with ten graded pipeline exercises: fix broken YAML, write matrices, cache keys, needs graphs, gating rules and secret handling.
- Common CI/CD Mistakes and Anti-Patterns Learn the CI/CD anti-patterns that waste time and cause incidents: leaked secrets, unpinned actions, slow jobs, ignored flaky tests, manual steps and no rollback.
- CI/CD Interview Questions Prepare for CI/CD interviews with answers on concepts, GitHub Actions, Jenkins, GitLab, pipeline security, deployment strategies and real scenarios.
- CI/CD Cheat Sheet A side-by-side CI/CD cheat sheet for GitHub Actions, Jenkins and GitLab: triggers, jobs, expressions, caching, secrets, artifacts and common recipes.