Typorithm · medium

GitHub Actions Workflow

gha-workflowdevopsgithub-actionsworkflowjobs
Saved on this device
Full lesson · 8 learning steps Open any exercise for focused practice
1

Step 1 of 8 · intro card

Learn GitHub Actions Workflow

0%

CI/CD

A GitHub Actions workflow is a YAML file in .github/workflows. on declares the events that trigger it, jobs lists units of work, each job names a runner with runs-on, and steps either use a published action or run a shell command.

A workflow lives in .github/workflows as a YAML file. The on key declares the events that trigger it — here a push to the main branch (pull_request is the other common trigger).

Inside jobs, each named job picks a runner with runs-on (ubuntu-latest is a fresh Linux VM). A workflow can have many jobs, which run in parallel by default.

A job is a sequence of steps. A step either uses a published action (uses: actions/checkout@v4 pulls your code) or runs a shell command (run: npm ci && npm test). Checkout, install, and test are the typical first steps.

01

Workflow YAML lives in .github/workflows.

02

on declares the triggering events (push, pull_request).

03

jobs run on a runner; steps use an action or run a command.

name: CI
on:
  push:
    branches: [main]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm test

Read the implementation

Connect each part of the code to the concept before you type.

1. Workflow name

name labels the workflow as it appears in the Actions tab.

name: CI

2. Trigger event

on declares which events start the workflow — here a push to main.

on:
  push:
    branches: [main]

3. A job

jobs holds named units of work; build is one job.

jobs:
  build:

4. Runner

runs-on picks the virtual machine (runner) the job executes on.

runs-on: ubuntu-latest

5. Use an action

uses runs a published action; checkout pulls your repo onto the runner.

- uses: actions/checkout@v4

6. Run a command

run executes a shell command — install dependencies then run tests.

- run: npm ci && npm test

A complete learning loop

01

Understand

Read the concept map and follow the code breakdown.

02

Reconstruct

Type the implementation, repair mistakes and work through every recall exercise.

03

Verify

Use the final check without hints; revisit weak concepts in short practice sessions.

GitHub Actions Workflow: Lesson & Practice · Typorithm | ApplyDjinn