- uses: actions/setup-node@v4
with:
node-version: 20
cache: npmPrefer first-party built-in caching support when available.
Cache dependencies, upload and download artifacts, and drive workflows with GitHub CLI commands in GitHub Actions.
Reduce workflow time by caching dependencies and build inputs.
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npmPrefer first-party built-in caching support when available.
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
.venv
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-Choose keys that change when dependencies change, and use restore keys for partial hits.
Store outputs and interact with workflows using `gh`.
Save files from the workflow run for later download or later jobs.
- uses: actions/upload-artifact@v4
with:
name: build-output
path: dist/Artifacts are great for test reports, build outputs, logs, and release bundles.
- uses: actions/download-artifact@v4
with:
name: build-output
path: ./artifactsArtifacts are a common way to hand off generated files between jobs.
gh workflow listUseful for debugging and automating workflow management from a terminal or script.
gh workflow run deploy.yml -f environment=stagingThe target workflow must define the `workflow_dispatch` trigger and compatible inputs.
gh run watchHelpful when you want live feedback without keeping the GitHub Actions page open.
Fetch artifacts from a completed workflow run.
gh run download RUN_ID -n build-outputGreat for pulling logs or build output from CI to your local machine.