How do I set up a CI/CD pipeline from scratch?

Neil Millard

First you need somewhere to orchestrate your CI/CD pipeline. This is a server or service that enables you to configure the pipeline and the steps that should happen.

There are lots of choices, most are yaml based.

  1. Jenkins is the oldest and most stable, with lots of plugin support.
  2. GitHub actions. built right into your git repo if you host on GitHub. Good community support of plugin 'actions'
  3. GitLab CI. Your go to if you are running your git repos out of GitLab
  4. Circle CI. A long time supporter of Open Source projects
  5. AWS CodeBuild. should you be hosting your apps on amazon, maybe stay native with AWS.

Once your orchestrator is in place. You need to design and create the pipeline.

At the basic level you should have

  1. Tests: automated unit tests, with security, code quality, and other guardrails you want for you and your developers. (or AI)
  2. Build: This stage will build your deployable artifact. A versioned binary, container image or runnable code.
  3. Deploy: host the artifact somewhere to test deployment
  4. Health: Healthchecks or integration testing. A higher level of testing when your code is not on your local machine.
  5. Approvals: Maybe you want an approval stage. The steps before this are call Continuous Integration. This step is a pivot to Continuous Deliver.
  6. Deploy to production environment(s). The penultimate step. The one that delivers the goods.
  7. Monitoring: similar the Health, but for production. Enables logging, dashboards, metrics and other monitoring tools.

For a first pipeline specifically, GitHub Actions is usually the fastest path if the code already lives on GitHub — a working build-test-deploy workflow can be a single .github/workflows/*.yml file with no separate CI server to run or maintain.

Need help with your DevOps setup?

Get personalised advice from Neil Millard — DevOps consultant based in Weston-super-Mare.