AcademyPipeline Pilot: The CI/CD Flight ManualAltitude 2: Auto-Pilot (Workflows)

Workflows and Events

A Workflow is an automated procedure added to your repository. They live in .github/workflows/ and must be YAML files.

Events (Triggers)

Workflows are triggered by events. The on keyword defines what event triggers the workflow.

# Trigger on every push to the repo
on: push

# Trigger only on pushes to the main branch
on:
  push:
    branches:
      - main

# Trigger on Pull Requests
on: pull_request

# Trigger manually via a button in the GitHub UI
on: workflow_dispatch
booting...

Mission Control

Create workflow directory

Expected Command

mkdir -p .github/workflows

Create workflow file