GitHub Actions Tutorial — Reusable Workflows

1 minute read

Chapter 10 — Reusable Workflows

Reusable workflows let you define a workflow once and call it from other workflows — like a function for your CI/CD pipelines. Instead of copy-pasting the same 50-line job across 20 repositories, you write it once and reference it everywhere.

This eliminates duplication, enforces consistency, and makes maintenance simple: update the reusable workflow in one place and every caller gets the fix.


What You’ll Learn

  • The workflow_call trigger and how it differs from other triggers
  • Defining inputs, outputs, and secrets in reusable workflows
  • Calling reusable workflows from other workflows
  • Composition patterns for complex pipelines
  • Sharing workflows across an organization

Topics Covered

1. workflow_call

The trigger that turns a workflow into a callable function.

Read: workflow_call →


2. Inputs, Outputs, Secrets

Pass data in and out of reusable workflows.

Read: Inputs, Outputs, Secrets →


3. Calling Workflows

How to invoke reusable workflows from caller workflows.

Read: Calling Workflows →


4. Composition Patterns

Chain multiple reusable workflows into complex CI/CD pipelines.

Read: Composition Patterns →


5. Org Shared Workflows

Share reusable workflows across repositories in a GitHub organization.

Read: Org Shared Workflows →


Practice

Test your understanding with hands-on exercises.

Practice Exercises →


← Previous: Chapter 9: Matrix Builds

Next: Chapter 11: Custom Actions →

Updated: