Last Updated: November 21, 2025
GitHub Actions
CI/CD automation for GitHub
Core Concepts
| Item | Description |
|---|---|
Workflow
|
Automated process defined in YAML |
Job
|
Set of steps that execute on a runner |
Step
|
Individual task (action or shell command) |
Action
|
Reusable unit of code |
Runner
|
Server that runs workflows |
Event
|
Activity that triggers a workflow |
Workflow Example
name: CI Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Build
run: npm run build
Common Events
| Item | Description |
|---|---|
push
|
Code pushed to repository |
pull_request
|
PR opened or updated |
schedule
|
Cron-based trigger |
workflow_dispatch
|
Manual trigger |
release
|
Release published |
Best Practices
- Cache dependencies to speed up builds
- Use matrix strategies for multiple environments
- Store secrets in GitHub Secrets
- Use reusable workflows to avoid duplication
💡 Pro Tips
Quick Reference
Use actions/cache to speed up workflow runs