INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: CI/CD design: from checks to release and recovery

CI/CD pipeline design: dependencies, artifacts and deployment targets

A pipeline connects stage inputs, outputs and execution conditions. A row of green boxes cannot explain concurrency or an old artifact entering deployment. Trace a fictional web-app change from source revision through artifact to destination.

What you will learn

Read stage dependencies and define how later stages receive the intended artifact with matching validation evidence.

Prerequisite

CI provides early feedback on changes. An artifact is a set of produced files. A/B below are teaching labels, not real commit IDs or cryptographic digests.

What does each stage receive and produce?

Fictional P1: prepare source B for deployment
StageInputOutput and success condition
Unit testsSource B and fixed fixturesDefined tests actually run against B and match expectations.
BuildSource B, dependencies and build settingsArtifact B plus recorded inputs and build conditions.
Artifact validationArtifact B and B’s test resultsEvidence about the files intended for deployment.
Release decisionB evidence, artifact B and target prodMatching targets, required checks and applicable approval.
Deploy and verifyApproved artifact B and prodVerify what is running and the required behavior.

Source revision identifies an input, artifact identity identifies delivered bytes, and the destination identifies where they are used. The same source can produce different outputs with different dependencies, settings or embedded build times. A shared zip name does not identify its contents.

Separate concurrent work from prerequisites

P1 dependencies: arrows identify prerequisites
P1 dependencies: arrows identify prerequisites1: Source B — Read B — Tests for B. 2: Source B — Build from B — Build artifact B. 3: Tests for B — Require B test evidence — Validate artifact B. 4: Build artifact B — Require artifact B — Validate artifact B. 5: Validate artifact B — Pass candidate evidence — Release decision12345Source BTests for BBuild artifact BValidate artifact BRelease decisionP1 dependencies: arrows identify prerequisites1: Source B — Read B — Tests for B. 2: Source B — Build from B — Build artifact B. 3: Tests for B — Require B test evidence — Validate artifact B. 4: Build artifact B — Require artifact B — Validate artifact B. 5: Validate artifact B — Pass candidate evidence — Release decision12345Source BTests for BBuild artifactBValidateartifact BReleasedecision
  1. Source B → Tests for BRead B
  2. Source B → Build artifact BBuild from B
  3. Tests for B → Validate artifact BRequire B test evidence
  4. Build artifact B → Validate artifact BRequire artifact B
  5. Validate artifact B → Release decisionPass candidate evidence
Source B
Identify revision and settings.
Tests for B
Compare fixtures with expectations.
Build artifact B
Record build inputs too.
Validate artifact B
Match both evidence sets.
Release decision
Check target, evidence, destination.

This is a dependency graph, not a duration or progress display. Tests and build have no dependency on each other in this example, so they can run concurrently. Artifact validation needs both. Actual start times also depend on runner availability and conditions.

GitHub Actions uses needs for job dependencies. Failure or skipping normally skips dependent jobs, subject to explicit conditions. Collecting diagnostic results after a failure is different from ignoring a failed prerequisite and deploying anyway.

Counterexample: B passes but artifact A is selected

P2: selecting latest.zip by name alone
RecordSourceArtifactDecision
Current testsBSource tests onlyEvidence for B, within test scope.
Current buildBBB is the candidate.
Zip fetched by deploy jobAADifferent from the B candidate: stop.

P2 cannot reuse a passing result for B as permission to deploy A. Bind source revision, run identity and artifact digest when saving the output, then check that association when consuming it. A digest helps identify bytes; it does not by itself establish the creator or safety.

Actions artifacts preserve and share produced files. Dependency caches reduce repeated retrieval or computation; they are not a release-selection policy. Plan for a missing cache while verifying that the selected deployment artifact is the intended output.

Staging evidence does not establish production success

Artifact B can behave differently with another database, environment configuration, permission set, network or secret reference. Identify environment differences; verify target selection, configuration and user-visible results separately. Do not compare secrets by printing them into logs.

CD can mean continuous delivery, keeping a change ready for deployment, or continuous deployment, automatically releasing qualifying changes to production. State the intended meaning and who controls the final action. Automation does not inherently remove human approval.

Keep identities traceable when a stage fails

  1. Write each stage’s inputs, outputs, privileges and conditions.
  2. Separate independent stages from stages requiring multiple results.
  3. Preserve and verify source, run, artifact and destination associations.
  4. Distinguish failure, no execution, cancellation and approval waits from success.
  5. Define how retries avoid stale artifacts or approvals.
  6. Plan post-deployment verification and the recoverable state.

Check dependencies and target consistency

Choose an option to see the result and explanation.

P1 tests and build do not depend on each other. Which reading is correct?
Read the answer and reason

Answer: They can run concurrently; artifact validation needs both. · Distinguish the dependencies from actual runner scheduling.

P2 tests B successfully, but deployment fetches A. What next?
Read the answer and reason

Answer: Stop and match intended B to its evidence. · Verify the downstream input is the intended candidate.

B works in staging. Is production behavior verified?
Read the answer and reason

Answer: No; verify production configuration, target and behavior. · Matching artifacts and matching environments are different conditions.

A prerequisite failed, but diagnostic collection should run. What distinction matters?
Read the answer and reason

Answer: Separate diagnostic continuation from deployment eligibility. · Running diagnostics leaves the prerequisite failure unresolved.

Check, then explain in your own words

  1. Explain P1 concurrency and prerequisites.
  2. Identify source, artifact and destination.
  3. Explain why P2 must stop.
  4. Define failure, retry and production-verification rules.
Check your understanding: B is rebuilt in production. Is it automatically the same as the artifact validated earlier?

No. Dependencies and settings can change output. Promote the validated artifact or explicitly verify the rebuilt candidate’s bytes, inputs and required checks.

Trace input revision, produced bytes and destination separately.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.