CI/CD: automate your application deployment
Pipelines, secrets, environments and idempotent deployments.

Key takeaways (TL;DR) Pipeline: Install → Lint → Test → Build → Scan → Deploy (staging → prod with approval). Secrets in CI secret store; prefer OIDC + vault/cloud secret manager over long‑lived keys. Idempotency and rollback via versioned artifacts or immutable Docker images. Observability: metrics, logs and alerts (SLI/SLO). Quality gates on tests/coverage.
CI/CD automates tests, builds and deployments so you can ship faster and safer. This guide proposes a reference pipeline, best practices and concrete examples withGitHub ActionsandGitLab CI.
Platforms & key tools
- GitHub Actions— YAML workflows, OIDC to cloud:github.com/features/actions
- GitLab CI— .gitlab-ci.yml, environments & approvals:docs.gitlab.com/ee/ci
- Jenkins— declarative pipelines:jenkins.io/doc
- Docker& registries (GHCR, GitLab Registry, ECR, GCR) for reproducible artifacts.
- Kubernetes+Argo CD/Flux(GitOps) for declarative deployments.
- Quality/Security:ESLint,Jest/PHPUnit,SonarQube,Trivy(images),Dependabot/Renovate.
Reference pipeline
- Install deps +cache(npm/pnpm/composer).
- Quality:lint,format,unit testsandcoverage.
- Security:SCA(deps),SAST(code),image scanif Docker.
- Build: artifact (zip) or taggedDocker image(app:1.2.3+sha).
- Stagingdeploy (auto) →e2e/smokechecks.
- Approval gate →productiondeploy (manual) +post‑deploy verification.
GitHub Actions example (Node)
GitLab CI example (Docker + Kubernetes)
Environments, secrets and security
- Useenvironments(staging, preprod, prod) withURLsandaccess rules.
- Prefer OIDC +cloud roles(AWS/GCP/Azure) over long‑lived keys; rotate secrets.
- Enableapprovals,code owners,branch protectionand security scans.
Deployment strategies
- Blue/Green: two environments; switch traffic after validation.
- Canary: progressively shift traffic (1% → 100%).
- Rolling: gradually replace pods/instances.
- Feature flagsto decouple release from deploy.
Tools mentioned GitHub Actions, GitLab CI, Jenkins, Docker, Kubernetes, Argo CD/Flux, SonarQube, Trivy, Dependabot/Renovate.
About the author
The Online Toolset editorial team produces practical guides on web development, image optimization, productivity, and digital tools.