CICD-103 · Set a restoration prefix
Encyclopedia · Workflow reuse and caching · All snippets
Previous · CICD-102 · Next · CICD-104
1. Where it fits
- Placement .github/workflows/ci.yml, under a job's steps.
- Prerequisites trusted checkout and cache/artifact support verified on the chosen Actions runner.
- Platforms github-actions.
2. Copy the snippet
yaml
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: "uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}"
restore-keys: uv-${{ runner.os }}-3. How it works
This invokes an action at step scope or a reusable workflow at job scope. The reference and declared inputs must match that contract.
4. Verify the result
A prefix can restore older downloads. Always run locked dependency installation.
Validation syntax-validated (YAML parse). Status definitions.