D1: Caching & Artifacts
GH-200 GitHub Actions exam practice questions · 11 flashcards
Question
actions/cache?
1 / 11
Tip: Space flips the card, ← / → navigate.
Show all 11 Caching & Artifacts practice questions and answers
- actions/cache?Caches dependencies between runs using key and restore-keys.
- Cache key best practice?Include OS and hashFiles of lockfile, e.g. ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}.
- restore-keys?Fallback prefixes for partial cache hits.
- Cache limits?Default 10 GB per repo; least recently used eviction; caches unused for 7 days evicted.
- setup-* built-in caching?actions/setup-node etc. support cache: npm/pip/maven.
- Artifacts?Files produced by jobs uploaded with actions/upload-artifact and downloaded with download-artifact.
- Artifact retention?Default 90 days (configurable 1–90 public, up to 400 private/enterprise) via retention-days or settings.
- Cache vs artifact?Cache: speed up reuse of dependencies. Artifact: persist/share job outputs and results.
- Retention policies via REST API?Set org/repo artifact and log retention (actions permissions API); delete artifacts/runs programmatically.
- Artifact immutability (v4)?Artifacts are immutable; unique names per job required.
- Cache scope across branches?Caches from default branch are accessible to other branches; branch caches isolated.