Understanding CI/CD Costs
This guide explains how GitHub Actions billing works and how CICosts helps you understand and manage your costs.
GitHub Actions Billing Model
How GitHub Charges
GitHub Actions charges based on:
- Minutes used - Actual runtime of your jobs
- Runner type - Larger runners cost more per minute
- Operating system - Windows and macOS cost more than Linux
Billing Calculation
Cost = Minutes × Rate per Minute
Where:
- Minutes are rounded up to the nearest minute
- Rate depends on runner size and OS
Runner Pricing
| Runner | Linux | Windows | macOS |
|---|---|---|---|
| 2-core (default) | $0.008/min | $0.016/min | N/A |
| 4-core | $0.016/min | $0.032/min | $0.08/min |
| 8-core | $0.032/min | $0.064/min | $0.12/min |
| 16-core | $0.064/min | $0.128/min | $0.24/min |
| 32-core | $0.128/min | $0.256/min | N/A |
| 64-core | $0.256/min | $0.512/min | N/A |
Free Minutes
GitHub includes free minutes with some plans:
| Plan | Free Minutes (Linux) |
|---|---|
| Free | 2,000 minutes |
| Pro | 3,000 minutes |
| Team | 3,000 minutes |
| Enterprise | 50,000 minutes |
Windows and macOS minutes are charged at higher multipliers:
- Windows: 2x multiplier
- macOS: 10x multiplier
What CICosts Tracks
Gross Costs
CICosts calculates gross costs - what you would pay without free minutes:
Gross Cost = All minutes × Runner rate
This helps you understand true resource consumption regardless of your plan.
Why Gross Costs?
- Consistency - Compare costs across plans
- Forecasting - Predict costs if you exceed free minutes
- Optimization - Find waste even within free tier
- Planning - Budget for growth
Mapping to Actual Bill
Your actual GitHub bill may be lower:
Actual Bill = max(0, Gross Cost - Free Minute Value)
CICosts shows both gross and estimated actual costs.
Understanding Your Spending
Where Money Goes
Typical cost distribution:
| Category | Typical % |
|---|---|
| CI/Test workflows | 40-50% |
| Build/Deploy | 20-30% |
| Scheduled jobs | 10-20% |
| Other | 10-20% |
The 80/20 Rule
Usually, 20% of workflows cause 80% of costs. CICosts helps you identify:
- Which workflows are expensive
- Why they're expensive
- How to optimize them
Cost Factors
Job Duration
Longer jobs cost more:
# This costs more
- run: npm test # 10 minutes = $0.08
# Than this
- run: npm test --parallel # 5 minutes = $0.04
Runner Size
Larger runners cost more per minute:
# Expensive
runs-on: ubuntu-latest-32-core # $0.128/min
# Cheaper
runs-on: ubuntu-latest # $0.008/min
But larger runners can reduce total time:
| Scenario | Runner | Time | Cost |
|---|---|---|---|
| A | 2-core | 30 min | $0.24 |
| B | 8-core | 8 min | $0.26 |
| C | 16-core | 5 min | $0.32 |
Operating System
macOS is significantly more expensive:
# Most expensive
runs-on: macos-latest # $0.08/min (4-core)
# Much cheaper
runs-on: ubuntu-latest # $0.008/min (2-core)
Matrix Builds
Matrix builds multiply costs:
strategy:
matrix:
os: [ubuntu, windows, macos] # 3 jobs
node: [16, 18, 20] # × 3 versions
# = 9 total jobs
This 10-minute workflow costs:
- 1 Ubuntu job: $0.08
- 9 matrix jobs: $0.72+
Workflow Triggers
Trigger frequency affects costs:
| Trigger | Typical Cost |
|---|---|
| push (main only) | Low |
| push (all branches) | Medium |
| pull_request | Medium |
| schedule (hourly) | High |
| workflow_dispatch | Varies |
Reading CICosts Data
Dashboard Metrics
| Metric | What It Means |
|---|---|
| Today | Cost so far today |
| vs Average | Comparison to your typical day |
| This Month | MTD spending |
| Projected | Estimated month-end total |
Trend Analysis
Look for:
- Spikes - Unusual high-cost days
- Patterns - Weekly or monthly cycles
- Trends - Increasing or decreasing over time
Per-Workflow Analysis
For each workflow, check:
- Average cost per run
- Success rate (failed runs still cost)
- Run frequency
- Duration trend
Key Questions to Ask
-
Which workflows cost the most?
- Check the "Top Workflows" view
-
Are we using appropriate runners?
- Check runner type distribution
-
Are matrix builds necessary?
- Compare matrix size vs. value
-
How much do failures cost?
- Check failure rate and cost
-
Are scheduled jobs worth it?
- Compare scheduled job costs to value
Next: Optimizing Workflows →