02Core Architecture

Understanding the Components

To master GitHub Actions, you need to understand how its parts work together. Think of it as a well-oiled machine: an event sparks the process, and a series of steps follow to reach the goal.

Interactive Execution Pipeline

Watch how an Event flows through the system to completion

Event
Workflow
Build
Test
Ubuntu
macOS

System Idle. Waiting for trigger...

The High-Level Flow

Event

The Trigger

Workflow

The Automation

Job

The Executor

Runner

The Machine

Events

The catalyst that starts it all. It can be a code push, a pull request, or even a scheduled time.

pushpull_requestscheduleworkflow_dispatch

Workflows

The main automated procedure. It's defined by a YAML file in your .github/workflows directory.

CI PipelineAuto-DeployLabeler

Jobs

A set of steps that run on the same runner. Jobs can run in parallel or wait for each other.

buildtestdeploy

Actions

Reusable, standalone tasks. You can write your own or use ones from the GitHub Marketplace.

checkoutsetup-nodecache

Runners

The virtual machine or container provided by GitHub (or your own) that performs the work.

ubuntu-latestwindows-latestmacos-latest

Steps

Individual tasks within a job. These can be shell commands or calls to specific Actions.

run: npm installuses: actions/checkout

The Hierarchy of Action

  1. Event Occurs

    Someone pushes code or opens a PR. GitHub detects this "event".

  2. Workflow is Triggered

    GitHub looks into your repository for any YAML files that "listen" to that event.

  3. Jobs are Assigned

    The workflow breaks down into Jobs. For example, one for testing and one for building.

  4. Runners Spin Up

    Each Job gets its own Runner (a fresh virtual machine).

  5. Steps Execute

    One by one, the commands run. If any step fails, the whole job usually stops.