Cache Action
ELI5 — The Vibe Check
Cache Action saves your node_modules (or pip packages, or whatever) between CI runs so you don't reinstall everything from scratch every time. First run: 3 minutes installing deps. Every run after: 5 seconds cache restore. It's like meal prepping but for your CI pipeline.
Real Talk
The actions/cache action in GitHub Actions caches dependencies and build outputs between workflow runs using a key-based system. Cache hits restore files instantly, while misses fall back to partial key matches. Supports path patterns and platform-specific cache keys.
Show Me The Code
steps:
- uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- run: npm ci
When You'll Hear This
"Cache action cut our CI time from 4 minutes to 45 seconds." / "The cache key is based on the lockfile hash — new deps bust the cache automatically."
Related Terms
Artifact Upload
Artifact Upload saves files from your CI job so other jobs (or humans) can download them later. Built your app? Upload the bundle. Ran tests?
Continuous Integration
Imagine a group project where everyone keeps adding their piece to a shared Google Doc and a robot instantly proofreads the whole thing every single time.
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.