teluzia.Cloud Engineer · Day 110
CHAPTER 16 · CI/CD AND AUTOMATED DEPLOYMENTS

Build-test-push-deploy workflow

4–5 hours including independent practice3 topics
LET’S MAKE THIS SIMPLE

What you’re learning today

A release pipeline is a sealed relay: each stage hands forward the same identified artifact rather than an untracked replacement. Run required checks before publication and deployment. Tie each stage to source revision and artifact identity. Separate credential-free checks from privileged publishing jobs where practical. A pipeline diagram should state precisely what is tested and which failures stop advancement. Registry publication needs scoped authorization and a deliberate repository target. OIDC can obtain temporary AWS credentials, while ECR login authenticates Docker to the registry. The GitHub role and runtime pull role are separate identities; do not share broad push rights with every workload.

Think of it this way

A release pipeline is a sealed relay: each stage hands forward the same identified artifact rather than an untracked replacement.

TOPIC 01 / 03Step by step

Build and test gates

Run required checks before publication and deployment. Tie each stage to source revision and artifact identity. Separate credential-free checks from privileged publishing jobs where practical. A pipeline diagram should state precisely what is tested and which failures stop advancement. For example, the build job produces image digest X after tests; the publish job records X and deploy uses X.

WORKED EXAMPLE
The build job produces image digest X after tests; the publish job records X and deploy uses X.

A release begins with a fixed revision. Tests pass, the image is built, and its identity is captured. Only then should a privileged publication stage run. If tests exercise source before building, additional image-level checks may still be needed to prove the packaging preserves required behavior. The stage graph must reflect that distinction.

A gate is a required condition for advancement. A revision identifies source. An immutable artifact identity identifies released content. Failures should stop the relevant path instead of become ignored warnings. Separate credential-free validation from publication where possible so ordinary contribution tests cannot gain deployment access. Fast parallelism is useful only when dependencies remain accurate. A test job finishing after deployment defeats the intended gate. Record exactly which checks ran and what they cover, rather than label every green workflow a complete integration or production validation.

Why this matters

The build job produces image digest X after tests; the publish job records X and deploy uses X.

A common trap

Do not overlook this operational distinction: A pipeline diagram should state precisely what is tested and which failures stop advancement.

MAKE IT VISIBLE

Rehearse a release decision

A RELEASE IS A SERIES OF DECISIONS

Can you ship without losing the old version?

This browser simulation shows why tests, plan review, health validation and rollback belong in a pipeline.

1Tests
2Plan review
3Deploy
4Health check
Currently serving: v1

Ready to run

Read all topics in this lesson

A complete reference to revisit alongside the guided steps above.

Build and test gates

Run required checks before publication and deployment. Tie each stage to source revision and artifact identity. Separate credential-free checks from privileged publishing jobs where practical. A pipeline diagram should state precisely what is tested and which failures stop advancement. For example, the build job produces image digest X after tests; the publish job records X and deploy uses X.

WORKED EXAMPLE
The build job produces image digest X after tests; the publish job records X and deploy uses X.

A release begins with a fixed revision. Tests pass, the image is built, and its identity is captured. Only then should a privileged publication stage run. If tests exercise source before building, additional image-level checks may still be needed to prove the packaging preserves required behavior. The stage graph must reflect that distinction.

A gate is a required condition for advancement. A revision identifies source. An immutable artifact identity identifies released content. Failures should stop the relevant path instead of become ignored warnings. Separate credential-free validation from publication where possible so ordinary contribution tests cannot gain deployment access. Fast parallelism is useful only when dependencies remain accurate. A test job finishing after deployment defeats the intended gate. Record exactly which checks ran and what they cover, rather than label every green workflow a complete integration or production validation.

Why this matters

The build job produces image digest X after tests; the publish job records X and deploy uses X.

A common trap

Do not overlook this operational distinction: A pipeline diagram should state precisely what is tested and which failures stop advancement.

Publish identity and authentication

Registry publication needs scoped authorization and a deliberate repository target. OIDC can obtain temporary AWS credentials, while ECR login authenticates Docker to the registry. The GitHub role and runtime pull role are separate identities; do not share broad push rights with every workload. For example, the pipeline pushes to one ECR repository and the application cluster pulls that digest with appropriate read access.

WORKED EXAMPLE
The pipeline pushes to one ECR repository and the application cluster pulls that digest with appropriate read access.

The publisher exchanges a GitHub token for a scoped AWS role, then obtains registry authentication and pushes the tested image to the intended ECR repository. Later, the runtime retrieves that image under its own identity. The publisher's authority to upload is different from the workload's authority to download and run it.

Federation obtains temporary cloud identity. Registry authentication lets the client communicate with the image registry. Authorization permits selected registry operations. Check the repository URI's account, region, and name before upload. A successful login does not prove push permission, and a successful push does not prove runtime pull permission. Do not share broad publisher credentials with every application merely to simplify setup. Capture the resulting digest rather than relying on latest. Publication is an artifact milestone; deployment still needs target configuration, capacity, network access, and health evidence.

Why this matters

The pipeline pushes to one ECR repository and the application cluster pulls that digest with appropriate read access.

A common trap

Do not overlook this operational distinction: The GitHub role and runtime pull role are separate identities; do not share broad push rights with every workload.

Deployment validation and release record

A deployment command reporting success is not sufficient evidence of user-visible health. Validate readiness and a meaningful endpoint, record environment, revision, digest, time, and previous release, and define failure handling. Concurrency controls should prevent conflicting simultaneous deployments to the same environment. For example, a release record stores the previous digest before updating the deployment and verifies /health afterward.

WORKED EXAMPLE
A release record stores the previous digest before updating the deployment and verifies /health afterward.

The deployment updates its image to a captured digest and waits for rollout with a finite timeout. It then sends a representative application request, inspects error behavior, and records success only if acceptance criteria pass. Before starting, it saves the previous release identity so failure handling has a concrete recovery candidate.

A rollout replaces runtime instances according to the platform strategy. Validation checks the required outcome. Concurrency control prevents conflicting release attempts targeting the same environment. A successful update command may only mean the configuration was accepted, not that new instances serve traffic. A rollback must also be validated and may be incompatible with changed database schemas. Record source, digest, environment, time, tests, and retained changes. This evidence makes a failed release diagnosable without rebuilding a mutable branch and hoping the replacement accidentally restores the previous behavior.

Why this matters

A release record stores the previous digest before updating the deployment and verifies /health afterward.

A common trap

Do not overlook this operational distinction: Concurrency controls should prevent conflicting simultaneous deployments to the same environment.

KEEP THESE WITH YOU

Today’s takeaways

Build and test gates: Run required checks before publication and deployment. Tie each stage to source revision and artifact identity. Separate credential-free checks from privileged publishing jobs where practical. A pipeline diagram should state precisely what is tested and which failures stop advancement.

Publish identity and authentication: Registry publication needs scoped authorization and a deliberate repository target. OIDC can obtain temporary AWS credentials, while ECR login authenticates Docker to the registry. The GitHub role and runtime pull role are separate identities; do not share broad push rights with every workload.

Deployment validation and release record: A deployment command reporting success is not sufficient evidence of user-visible health. Validate readiness and a meaningful endpoint, record environment, revision, digest, time, and previous release, and define failure handling. Concurrency controls should prevent conflicting simultaneous deployments to the same environment.

CLOSE THE LOOP

Ready to complete this day?

Verify the practical steps and pass the knowledge check (at least two thirds correct).

Lab steps verifiedKnowledge check passed