GitHub CI
Write and maintain GitHub Actions CI workflows with confidence. This skill covers workflow design, runner configuration, testing patterns, and security best practices for continuous integration pipelines on GitHub.
Intent Router
Load reference files for depth on specific topics:
| Topic |
File |
Load when... |
| Workflow Basics |
resources/workflow-basics.md |
Learning workflow YAML structure, triggers, jobs, and built-in actions |
| Runners & Caching |
resources/runners-and-caching.md |
Configuring runners, setting up caching, or optimizing build performance |
| Testing Patterns |
resources/testing-patterns.md |
Implementing test runs, reporting results, or integrating coverage tools |
| Security & Secrets |
resources/security-and-secrets.md |
Managing secrets, permissions, and third-party action safety |
Quick Start
Basic GitHub Actions Workflow
- Create workflow file — Save as
.github/workflows/ci.yml in repository root
- Define triggers — Use
on: to specify when workflow runs (push, pull_request, schedule)
- Configure job — Define jobs with name, runner type, and steps
- Add checkout — Use
actions/checkout@v4 to access repository code
- Run commands — Add steps with
run: or use community actions
Minimal Workflow
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "Running CI pipeline"
Workflow Anatomy
workflow
├── name: Display name
├── on: Trigger events (push, pull_request, schedule, workflow_dispatch)
├── env: Workflow-level environment variables
└── jobs:
└── <job-name>:
├── runs-on: Runner type (ubuntu-latest, windows-latest, macos-latest)
├── env: Job-level environment variables
├── strategy: Matrix, fail-fast, max-parallel settings
└── steps:
├── uses: Pre-built action
└── run: Shell command or script
File Location
All workflows must be in .github/workflows/ directory with .yml or .yaml extension. Use kebab-case for filenames: build-and-test.yml, deploy-production.yml.
Quick Validation
Validate YAML syntax before pushing:
docker run --rm -v "$(pwd):/data" pipelinecomponents/yamllint yamllint /data/.github/workflows/
1---2name: github-ci3description: Write and maintain GitHub Actions CI workflows, including workflow YAML structure, triggers, runners, matrix builds, caching, testing patterns, and secrets management. Use when working with .github/workflows, GitHub Actions, CI pipelines, workflow dispatch, or action configuration.4license: MIT5---6
7# GitHub CI
8
9Write and maintain GitHub Actions CI workflows with confidence. This skill covers workflow design, runner configuration, testing patterns, and security best practices for continuous integration pipelines on GitHub.
10
11---
12
13## Intent Router
14
15Load reference files for depth on specific topics:
16
17| Topic | File | Load when... |
18| --- | --- | --- |
19| Workflow Basics | `resources/workflow-basics.md` | Learning workflow YAML structure, triggers, jobs, and built-in actions |
20| Runners & Caching | `resources/runners-and-caching.md` | Configuring runners, setting up caching, or optimizing build performance |
21| Testing Patterns | `resources/testing-patterns.md` | Implementing test runs, reporting results, or integrating coverage tools |
22| Security & Secrets | `resources/security-and-secrets.md` | Managing secrets, permissions, and third-party action safety |
23
24---
25
26## Quick Start
27
28### Basic GitHub Actions Workflow
29
301. **Create workflow file** — Save as `.github/workflows/ci.yml` in repository root
312. **Define triggers** — Use `on:` to specify when workflow runs (push, pull_request, schedule)
323. **Configure job** — Define jobs with name, runner type, and steps
334. **Add checkout** — Use `actions/checkout@v4` to access repository code
345. **Run commands** — Add steps with `run:` or use community actions
35
36### Minimal Workflow
37
38```yaml
39name: CI
40
41on:
42 push:
43 branches: [main]
44 pull_request:
45 branches: [main]
46
47jobs:
48 test:
49 runs-on: ubuntu-latest
50 steps:
51 - uses: actions/checkout@v4
52 - run: echo "Running CI pipeline"
53```
54
55### Workflow Anatomy
56
57```yaml
58workflow
59├── name: Display name
60├── on: Trigger events (push, pull_request, schedule, workflow_dispatch)
61├── env: Workflow-level environment variables
62└── jobs:
63 └── <job-name>:
64 ├── runs-on: Runner type (ubuntu-latest, windows-latest, macos-latest)
65 ├── env: Job-level environment variables
66 ├── strategy: Matrix, fail-fast, max-parallel settings
67 └── steps:
68 ├── uses: Pre-built action
69 └── run: Shell command or script
70```
71
72### File Location
73
74All workflows must be in `.github/workflows/` directory with `.yml` or `.yaml` extension. Use kebab-case for filenames: `build-and-test.yml`, `deploy-production.yml`.
75
76### Quick Validation
77
78Validate YAML syntax before pushing:
79
80```bash
81docker run --rm -v "$(pwd):/data" pipelinecomponents/yamllint yamllint /data/.github/workflows/
82```