跳到主要内容

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

FeatureArtifactsCache
PurposePass build outputs (across Jobs)Accelerate dependency installation (across runs)
LifecycleCan set retention daysLong-term retention, LRU eviction
Access ScopeBetween Jobs in the same WorkflowAcross all runs in the same repository