CI/CD

Design a CI Workflow with Triggers, Jobs, and Steps

Design a CI workflow by separating the triggering event, job dependencies, runner context, individual steps, and retained run evidence.

Intermediate14 min read
CI/CD lessonDelivery and reliability foundationsLearn

Design a CI workflow by separating the triggering event, job dependencies, runner context, individual steps, and retained run evidence.

What you will be able to do

  • Distinguish trigger event from job graph in a realistic design a ci workflow with triggers, jobs, and steps case.
  • Interpret the delivery evidence and boundary associated with runner context.
  • Choose an appropriate action involving step command without exceeding the named operational scope.
  • Verify run evidence through an observable service result and reproducible handoff.

01

Frame Design a CI Workflow with Triggers, Jobs, and Steps

Design a CI workflow by separating the triggering event, job dependencies, runner context, individual steps, and retained run evidence.

A repository needs pull-request checks and a main-branch package build. One workflow must make the trigger and ordering visible without mixing deployment credentials into tests.

Keep the delivery target, declared intent, execution evidence, reliability boundary, and recovery choice separate. Start with observable state and preserve enough context for another operator to reproduce the decision.

02

Trigger event

A workflow trigger defines which repository event and reference begin an automated run. Within design a ci workflow with triggers, jobs, and steps, this role answers a separate delivery or reliability question and keeps its own evidence.

Limit pull-request and push triggers to the intended branches and paths. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not run privileged release work for every untrusted event. The observable result is specific: only qualifying events create the expected workflow run.

03

Job graph

Jobs group steps and can express dependencies between parallel or ordered work. Within design a ci workflow with triggers, jobs, and steps, this role answers a separate delivery or reliability question and keeps its own evidence.

Place package creation after the required verification jobs. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not depend on visual file order when a job dependency is required. The observable result is specific: the run graph waits for required jobs before packaging.

04

Runner context

A runner supplies the machine and tool environment for a workflow job. Within design a ci workflow with triggers, jobs, and steps, this role answers a separate delivery or reliability question and keeps its own evidence.

Choose a runner whose platform matches the build and security needs. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not assume hosted and self-hosted runners share isolation properties. The observable result is specific: the job executes on the declared runner environment.

05

Step command

A step runs a script or reusable action within its containing job. Within design a ci workflow with triggers, jobs, and steps, this role answers a separate delivery or reliability question and keeps its own evidence.

Give each build, test, and upload operation a focused step. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not combine unrelated privileged actions into one opaque command. The observable result is specific: step results show exactly where a job succeeded or failed.

06

Run evidence

Workflow evidence connects the event, commit, jobs, logs, and produced outputs. Within design a ci workflow with triggers, jobs, and steps, this role answers a separate delivery or reliability question and keeps its own evidence.

Retain the run link and revision with the reviewed result. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not report success without identifying the workflow execution. The observable result is specific: a reviewer can reconstruct the complete run from stored evidence.

07

Apply Design a CI Workflow with Triggers, Jobs, and Steps to One Service Change

Use one bounded delivery decision: A repository needs pull-request checks and a main-branch package build. One workflow must make the trigger and ordering visible without mixing deployment credentials into tests.

First, limit pull-request and push triggers to the intended branches and paths. Then, place package creation after the required verification jobs. Keep both observations attached to the exact revision, environment, or service window.

Next, choose a runner whose platform matches the build and security needs. After that, give each build, test, and upload operation a focused step. Close the work only after you retain the run link and revision with the reviewed result.

08

Recap Before Practice and Prove

Trigger event: A workflow trigger defines which repository event and reference begin an automated run. In this service case, limit pull-request and push triggers to the intended branches and paths. Preserve the boundary: do not run privileged release work for every untrusted event.

Job graph: Jobs group steps and can express dependencies between parallel or ordered work. In this service case, place package creation after the required verification jobs. Preserve the boundary: do not depend on visual file order when a job dependency is required.

Runner context: A runner supplies the machine and tool environment for a workflow job. In this service case, choose a runner whose platform matches the build and security needs. Preserve the boundary: do not assume hosted and self-hosted runners share isolation properties.

Step command: A step runs a script or reusable action within its containing job. In this service case, give each build, test, and upload operation a focused step. Preserve the boundary: do not combine unrelated privileged actions into one opaque command.

Run evidence: Workflow evidence connects the event, commit, jobs, logs, and produced outputs. In this service case, retain the run link and revision with the reviewed result. Preserve the boundary: do not report success without identifying the workflow execution.

NEXT STEP

Turn reading into recall

Practice the concepts without a timer, with coaching and retry available after every answer.

Open guided practice