actions/download-artifact: Retrieve Build Outputs
download-artifact retrieves files a previous job uploaded, so jobs can hand work off.
Download a single named artifact, or use pattern/merge to pull several into one directory. Commonly used to ship a build from a build job to a deploy job.
Key inputs (with:)
- name: artifact to download; omit to fetch all.
- path: destination directory.
- pattern: glob to match multiple artifact names.
- merge-multiple: flatten matched artifacts into one path.
- run-id / github-token: download from another workflow run.
Example workflow
.github/workflows/ci.yml
jobs:
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- run: ./deploy.sh dist/On any runner
Artifact download works on any runner. Latchkey managed runners run it unchanged.
Key takeaways
- Omit name to download every artifact from the run.
- Use needs: to order the producing and consuming jobs.
- run-id plus a token pulls artifacts across workflow runs.
Related guides
actions/upload-artifact: Persist Build OutputsReference for actions/upload-artifact: save files and directories from a job for download or later jobs, with…
actions/checkout: Inputs & Workflow UsageReference for actions/checkout: clone your repository into the runner, control fetch-depth, submodules, refs,…
softprops/action-gh-release: Publish GitHub ReleasesReference for softprops/action-gh-release: create or update a GitHub Release on tag pushes and upload assets,…