How to Pass Artifacts Between Steps in Bitbucket Pipelines
Bitbucket Pipelines hands files to later steps with the artifacts: keyword - the only way to share output across its isolated step containers.
List glob paths under a step's artifacts:. Bitbucket captures matching files and automatically makes them available to all subsequent steps in the same pipeline.
Produce and consume artifacts
The build step declares dist/** as artifacts; the deploy step downloads them automatically.
bitbucket-pipelines.yml
pipelines:
default:
- step:
name: Build
image: node:20
script:
- npm ci && npm run build
artifacts:
- dist/**
- step:
name: Deploy
script:
- ./deploy.sh dist/Gotchas
- Artifacts are passed downstream automatically to later steps - you do not "download" them explicitly.
- Artifact paths are relative to
$BITBUCKET_CLONE_DIR; absolute paths outside it are not captured. - Artifacts are kept for 14 days and capped in size - they are for handoff, not long-term storage.
Related guides
How to Upload Build Artifacts in GitHub ActionsUpload and download build artifacts in GitHub Actions with actions/upload-artifact and download-artifact - pa…
How to Run Parallel Steps in Bitbucket PipelinesRun steps in parallel in Bitbucket Pipelines with the parallel: keyword to fan out test and lint steps and cu…