Start from the questions people will ask
A service owner, an assessor or an incident lead will eventually ask which version is running where, which commits it contains, what tests it passed, who approved it and how to return to the previous version. The GOV.UK Service Manual sets out the same expectations: deploy little and often, know which version runs in each environment, and be able to trace a production change back to its source. Design the pipeline so that those answers are produced as a side effect of releasing.
Build once and promote the same artefact
Build the container image once, then promote that same image through every environment and supply environment-specific settings at deployment time. Store images in Amazon ECR with tag immutability enabled, so that a tag such as a version number cannot later be pointed at a different image, and reference images by digest in the deployment configuration. Keep secrets in a managed store and out of the image.
Remove long-lived credentials
Build systems are an attractive target because they often hold powerful keys. GitHub Actions and similar tools can exchange a short-lived OpenID Connect token for temporary AWS credentials through a trusted IAM role, so no permanent keys need to be stored. Combined with GitOps, the build pipeline only needs permission to push an image and open a pull request, and the cluster pulls the approved change itself.
Make each stage leave a record
Each step should leave something that can be found later. The pull request records the review and approval. The build records the commit, the image digest and a software bill of materials. Test and scan results are stored against the build, with the thresholds that block a release agreed in advance with the service owner. The deployment tool records which commit was applied to which environment and when. Smoke tests then check the essential user tasks, and the release is rolled back or halted if they fail.
Treat rollback as a tested path
Rolling back a GitOps deployment usually means reverting a commit, which is quick if the previous version can still run against the current data. Design database changes so that old and new versions can operate side by side for at least one release, rehearse the rollback in a pre-production environment and record how long it takes. That record is worth more at acceptance than any statement that rollback is supported.
Keep it proportionate
A small service with one team does not need every control from day one. Immutable artefacts, traceable commits, credentials that expire and a rollback that has actually been practised cover most of the risk. Image signing, build provenance and stricter policy checks can follow where the data, the user base or the threat model justify the extra work.
Read about platform engineering or discuss your path to production.
Further reading
GOV.UK Service Manual: deploying software regularly
Amazon ECR: image tag mutability
GitHub Docs: configuring OpenID Connect in Amazon Web Services
