← All insightsGetting Started

Getting started with GitLab CI/CD

CodeWizard Engineering · 6 July 2026 · 3 min read · Beginner

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.

Why teams use it

  • One platform for SCM, CI/CD, registry and security scanning
  • Pipelines-as-code with reusable includes and templates
  • Built-in environments, review apps and manual deploy gates

Install it

bash
# Register a self-managed runner (Docker executor)
gitlab-runner register --url https://gitlab.com \
  --registration-token $TOKEN --executor docker --docker-image alpine:3

A first working config

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"' }]

Run and verify

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

Mistakes to avoid early

  • Everything in one stage, so nothing runs in parallel
  • No cache/artifacts config, re-downloading dependencies every job
  • Secrets in .gitlab-ci.yml instead of masked/protected CI variables

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