← All insightsConcepts

GitLab CI/CD: core concepts and configuration explained

CodeWizard Academy · 5 July 2026 · 3 min read · Beginner

Pipelines-as-code baked into GitLab, with built-in registry, environments and security scanning. This walkthrough covers the mental model and the configuration you will actually touch.

GitLab CI/CD runs pipelines defined in .gitlab-ci.yml on GitLab Runners, with stages, jobs, environments and built-in DevSecOps scanning - all in one platform next to the repo.

The configuration that matters

Stages, caching and a manual production gate.

yaml
stages: [build, test, deploy]
cache: { paths: [node_modules/] }

build:
  stage: build
  image: node:20
  script: [npm ci, npm run build]

test:
  stage: test
  image: node:20
  script: [npm test]

deploy:prod:
  stage: deploy
  script: [./deploy.sh]
  environment: { name: production }
  when: manual
  rules: [{ if: '$CI_COMMIT_BRANCH == "main"' }]

Principles to hold onto

  • Use stages and needs: for a fast DAG pipeline
  • Cache dependencies and pass build output as artifacts
  • Store secrets as masked, protected CI/CD variables

Everyday commands

bash
# Validate and lint the pipeline before pushing
gitlab-ci-local --list
glab ci lint

Want senior help putting GitLab CI/CD to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult