Artifacts and Cache
This document introduces the Artifacts and Cache mechanisms of AtomGit Action, used to pass build outputs across Jobs and accelerate dependency installation.
Artifacts
Artifacts are files generated during a Workflow run, which can be passed across Jobs:
steps:
- uses: upload-artifact
with:
name: build-output
path: dist/
- uses: download-artifact
with:
name: build-output
path: ./app
Cache
Cache is used to speed up dependency installation, avoiding repeated downloads:
steps:
- uses: cache
with:
key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
path: ~/.npm
restore-keys: |
npm-${{ runner.os }}-
Artifacts vs Cache
| Feature | Artifacts | Cache |
|---|---|---|
| Purpose | Pass build outputs (across Jobs) | Accelerate dependency installation (across runs) |
| Lifecycle | Can set retention days | Long-term retention, LRU eviction |
| Access Scope | Between Jobs in the same Workflow | Across all runs in the same repository |