Skip to content
nexovia

DevOps and cloud

DevOps and CI/CD

A CI/CD pipeline turns a release into a routine. Every pull request is built and tested in GitHub Actions, and every merge produces a Docker image that is the same in development, staging and production. Deployment replaces the running containers with that image, and rolling back means starting the previous image again.

DevOps and CI/CD: an overview

A team's release habits show in its pipeline. When the pipeline is slow, flaky or skipped, people batch changes together, release less often and fear each release more. When it is fast and trusted, a small change goes out soon after it is merged, and a broken one is undone in a single step.

Our CI/CD pipeline setup follows a few rules. The Docker image is built once, from the merged commit, and that exact image is promoted from the test environment to staging and then to production. Tests run on every pull request, and a pull request cannot be merged while they fail. Database migrations are a pipeline step, run before the new version takes traffic and written so that the previous version still works against the new schema.

Rollback is the part people skip. Here it means redeploying the previous image tag, which the pipeline already knows, so nobody rebuilds anything under pressure. Changes that cannot be reversed so easily, such as a migration that drops a column, are split across two releases: first the code stops using the column, then a later release removes it.

What the service covers

  • Pull request checks

    Linting, type checks, unit and integration tests run on every pull request, in containers that match production. Branch protection blocks the merge while any of them fails.

  • Image build and registry

    One Docker image per merge, tagged with the commit hash and pushed to your registry. Layer caching keeps the build short enough that people actually wait for it.

  • Preview environments

    Where the application allows it, each pull request gets a temporary environment at its own address. Reviewers and end-to-end tests use it before the merge.

  • Database migrations

    Migrations run as a pipeline step before the new version takes traffic. They are written to stay compatible with the previous version, so a rollback still works.

  • Deployment and promotion

    The same image moves from test to staging to production, with an approval before production if you want one. The target can be a server, a managed platform or Kubernetes, whichever the project runs on.

  • Rollback and runbooks

    Rolling back redeploys the previous image tag in one command. A runbook explains what to do when a release fails halfway.

When it is the right call

  • 01

    Releases happen from one person's machine, and only that person knows the steps.

  • 02

    Your test suite exists but nobody trusts it, so failed runs are restarted until they pass.

  • 03

    Each environment is built separately, and bugs appear in production that never showed up in staging.

  • 04

    Database changes are applied by hand, and a release can fail halfway through a migration.

What you get

  • CI/CD pipeline in GitHub Actions: build, tests, image, deployment

  • Docker images identical in development and production, one container per service

  • Staging environment that mirrors production

  • Rollback in one command and verified backups

How we work on it

  1. Step 1

    Trace one release

    We follow a real change from commit to production and note every step, every manual action and every wait. This shows where the release path loses time and where it takes risks.

  2. Step 2

    Agree on the design

    We write down the stages, the environments, who approves a production release and what blocks a merge. Existing jobs that work are kept and listed in that design.

  3. Step 3

    Build the pipeline

    GitHub Actions takes over build, tests, image publishing and deployment, plus preview environments where they are useful. Secrets come from encrypted repository settings or a secret manager, never from the workflow files.

  4. Step 4

    Add migrations and rollback

    Migrations move into the pipeline, and rollback to the previous image is scripted. We break a deployment in staging on purpose to check that rollback works.

  5. Step 5

    Release together

    Workflow files, a README and a runbook for failed releases go into your repository. Your developers run the next releases themselves while we watch.

What the CI pipeline checks on every pull request

On each pull request the pipeline installs dependencies from the lockfile, runs the linter and the type checker, then unit and integration tests in containers against a real PostgreSQL or Redis rather than mocks. End-to-end tests with Playwright run against a preview environment built from the same image that would ship. Dependency and image scanning run in the same workflow, so a known vulnerability shows up next to the change that introduced it.

Speed matters as much as coverage, because a pipeline that takes too long gets bypassed. We cache dependencies and Docker layers, run independent jobs in parallel, and move the slowest end-to-end suites to the merge on the main branch when running them on every pull request would make people stop waiting for results.

Build once and promote the same Docker image

Rebuilding the image for each environment means production runs something that was never tested. Instead, the pipeline builds one image per merge, tags it with the commit hash and pushes it to a registry. Test, staging and production pull that tag, and only their configuration differs: environment variables and secrets injected when the container starts.

This makes rollback cheap. The registry keeps earlier tags, the deployment records which tag is live, and going back is a deployment of the previous tag. What a rollback cannot undo is a change to data, which is why every migration is written to stay compatible with the version before it.

Database migrations in the deployment pipeline

A migration run by hand before or after a deployment is a frequent reason for a release failing halfway. In the pipeline, migrations run as their own step with the new image, after the backup check and before traffic moves to the new version. If the migration fails, the deployment stops and the old version keeps serving.

What makes this safe is the expand and contract pattern. A release first adds what the new code needs, such as a nullable column or a new table, without removing anything the old code reads. Once the new version has run in production for a while, a later release removes the old column. Each step can be rolled back on its own, and long data backfills run as background jobs instead of inside the deployment.

Technologies

  • Docker
  • Kubernetes
  • Helm
  • Argo CD
  • Terraform
  • GitHub Actions
  • AWS
  • Google Cloud
  • Grafana

How you can work with us

  • Fixed-scope project

    The scope of the first version is written down, split into milestones and priced per milestone. It suits a product or a feature with a clear outline.

  • Dedicated team

    A team works on your product over the long run, with its own planning and release cadence. It suits a product that keeps changing.

  • Team extension

    One or more of our engineers join your team and work with your tools and routines. It suits a company that knows where it is going but lacks people or a specific skill.

  • Monthly support

    A monthly retainer covers maintenance, updates and small changes, with an agreed response time. It suits a product in production that needs upkeep more than new features.

Questions about DevOps and CI/CD

What affects the effort of setting up CI/CD?

Mainly the number of services and environments, the state of the existing tests and how the application is deployed today. A single service with a working test suite is quick to wire up. Several services with few tests and manual database changes take longer, because a pipeline can only check what has been made checkable.

Do we have to use GitHub Actions?

No. GitHub Actions is convenient when the code is on GitHub, because it needs no separate server. If you already run another CI system that works, we usually keep it and apply the same principles to it: build once, test every pull request and promote the same image. Moving to GitHub Actions is worth it only when the current system is a real problem, for example a self-hosted CI server nobody maintains.

Do we need a staging environment as well as preview environments?

Usually yes, because they answer different questions. A preview environment shows one pull request on its own, for review and end-to-end tests. Staging runs the exact image headed for production with production-like configuration, and it is where migrations are rehearsed before they run for real.

How long does it take to set up a CI/CD pipeline?

It depends less on the pipeline than on the application around it. Tests that need fixing, configuration hard-coded per environment, or migrations that were always run by hand have to be sorted out before the pipeline can rely on them. We start with the build and the pull request checks, which are useful early, and add deployment, preview environments and rollback as separate milestones.

Can deployments happen without downtime?

Yes, as long as the application and the hosting allow it. The new version starts next to the old one, passes its health checks and receives traffic, and only then is the old one stopped. The mechanism differs between Nginx on a server, a managed platform and Kubernetes, but the idea is the same. What usually breaks it is a migration that is not backward compatible or sessions kept in the memory of a single container, and both can be fixed.

Who maintains the pipeline after the project?

Your developers, with the workflow files in the repository next to the code. Shared steps live in reusable workflows, so a change to the build applies to every service at once. Actions and base images are pinned to versions, and a dependency bot opens pull requests to update them, which someone on your side or ours reviews.

In the same service area

Design, build and ship your project

Describe it in three lines. We reply with specific questions and a first take on how to proceed.