Workflows and Workflow Files
What you'll learn: How GitHub Actions organizes automation instructions into workflow files stored in a specific directory structure.
What Are Workflows?
A workflow is a configurable automated process made up of one or more jobs that run when triggered by an event (like a push, pull request, or schedule). Think of a workflow as a recipe: it defines what to do, when to do it, and in what order. Each workflow is defined in a separate YAML file, making it version-controlled, reviewable, and portable.
The .github/workflows Directory
GitHub Actions expects workflow files to live in a specific location in your repository: .github/workflows/. This is your automation control center. Any YAML file (.yml or .yaml) placed here becomes an active workflow that GitHub will recognize and can execute.
my-repository/
├── .github/
│ └── workflows/
│ ├── ci.yml
│ ├── deploy.yml
│ └── security-scan.yml
├── src/
└── README.md
Each file represents a separate, independent workflow with its own triggers, jobs, and steps.
Workflow File Anatomy
Workflow files are written in YAML format and must include:
- A
name(optional but recommended for clarity) - One or more
ontriggers (what event starts the workflow) - One or more
jobs(the work to perform)
The directory structure is simple but powerful—multiple workflows can coexist, each handling different automation tasks like testing, deployment, or security scanning.
Key Takeaway: Workflows are defined as YAML files in .github/workflows/, where each file represents a separate automated process that GitHub Actions can execute based on repository events.