Job Dependencies
ELI5 — The Vibe Check
Job Dependencies tell GitHub Actions 'don't start job B until job A finishes.' Build before test. Test before deploy. It's like telling a kitchen: don't plate the food until it's actually cooked. The 'needs' keyword is your workflow's traffic controller.
Real Talk
The 'needs' keyword in GitHub Actions creates explicit dependencies between jobs, ensuring execution order. Jobs without dependencies run in parallel by default. A job can depend on multiple jobs and access their outputs. Failed dependencies skip downstream jobs.
Show Me The Code
jobs:
build:
runs-on: ubuntu-latest
steps: [...]
test:
needs: build
runs-on: ubuntu-latest
steps: [...]
deploy:
needs: [build, test]
runs-on: ubuntu-latest
steps: [...]
When You'll Hear This
"Deploy needs both build and test to pass before it runs." / "Jobs without 'needs' run in parallel — great for independent test suites."
Related Terms
Concurrency Groups
Concurrency Groups prevent CI chaos when you push 5 commits in a row. Instead of running 5 deploys, it cancels the old ones and runs only the latest.
GitHub Actions
GitHub Actions is CI/CD built right into GitHub. Push code, run tests, deploy — all from YAML files in your repo. No separate CI server needed.
Matrix Strategy
Matrix Strategy is CI/CD's way of testing every combo without writing every combo. Test on Node 18, 20, and 22? On Ubuntu and macOS?