Demos and production are different sports. This checklist covers what changes when GitLab CI/CD has to be reliable, secure and observable under real load.
Security and reliability defaults
- Enable built-in SAST, dependency and container scanning templates
- Mark secret variables masked+protected and scope them to protected branches
A production-minded config
Stages, caching and a manual production gate.
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"' }]Operational best practices
- 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
In production, boring and reproducible beats clever every time.
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.