Skip to content

starchenko.dev

Blog
All posts

My journey with CI/CD

· 3 min read · CI/CD · GitHub Actions · ArgoCD

I started with GitHub Actions. Each service built in its own repository, with workflows for checks and releases. CD lived separately, in the repository with Helm charts, and also ran through Actions.

The Java service workflows set up Java and Maven, ran tests and published reports. Release workflows prepared the version and published the Maven artifact and Docker image. These steps were repeated across services.

Java and Maven setup, build and unit tests in a service workflow
CI in a service repository: environment setup, Maven and tests.

CD from the Helm chart repository

The workflow in the chart repository connected to the cluster, applied shared configuration, then went through the applications and deployed their charts. In an early version, the main loop looked like this:

for app in $UPDATED_APPS; do
  helm upgrade --install $app applications/$app --values applications/$app/values.yaml
done
Early deployment workflow with kubectl apply and a helm upgrade --install loop
Early deployment: shared configuration and Helm charts applied from GitHub Actions.

Manual triggering, a cluster connection check and waiting for rollout came later. The entire deployment sequence lived in a script that was gradually becoming unwieldy.

I checked the running services separately. To find the current version, for example, I opened Lens and checked the labels. Developers also needed a way to inspect their services, deploy a new version or roll one back.

Moving CD to ArgoCD

I then moved CD to ArgoCD and removed the old Actions deployment workflow.

ArgoCD took over deployment from the Helm loop in Actions. I used Applications to separate deployments by environment. The interface showed application state and deployment history and let us trigger a sync.

ArgoCD application resource tree with a Deployment, Service and ReplicaSet
An application's resource tree in ArgoCD.

I enabled auto-sync for the backend. A developer changed the service version in the Helm chart's values.yaml and merged the change. ArgoCD then applied the configuration to the corresponding environment.

Infrastructure stayed on manual sync. I gave developers access to the backend applications: they could release their services themselves, while I applied infrastructure changes.

For a rollback, we could restore the previous version in values.yaml. The other option was to roll back through the ArgoCD interface after disabling auto-sync.

Shared build workflows

Builds continued to run in the service repositories. The next change was moving the shared steps into a separate repository of reusable workflows.

Calls to shared workflows replaced the full scripts in the services.

A service repository now defines the trigger events, permissions, parameters and a reference to the shared workflow:

uses: <org>/<shared-workflows>/.github/workflows/push.yml@main

Parameters include, for example, the Java version and whether to run integration tests. The steps themselves live in the shared repository: Java and Docker builds, release preparation and publication.

Each service still builds in its own repository. The CI implementation is now shared. Build configuration can be changed in one place instead of maintaining copies across services.

The calls reference @main, so a change to a shared workflow reaches its consumers' next runs. That change needs to be checked with the services that use the workflow in mind.

Releasing a version and deploying it remained separate actions. GitHub Actions builds and publishes the image. A developer updates the version in the Helm values, and ArgoCD deploys it to the environment after the merge.

ReadEscaping the Oracle dorm for our own PostgreSQL