How to Reduce Artifact Upload Time in CI
Uploading thousands of tiny files is slow. Upload less, compress it, and artifacts stop being a bottleneck.
Artifact steps move data over the network. The cost scales with file count and total size, so trim both.
Upload only what you need
Scope paths tightly and exclude noise like node_modules or coverage temp files.
.github/workflows/ci.yml
- uses: actions/upload-artifact@v4
with:
name: dist
path: |
dist/**
!dist/**/*.map
retention-days: 5
compression-level: 9Bundle many small files
A directory of thousands of small files uploads slowly. Tar it first so it transfers as one stream, then untar on download.
Lower retention
Short retention-days keeps storage and listing fast and trims your bill. Keep long retention only for release artifacts you actually need.
Key takeaways
- File count, not just size, drives upload time.
- Tar many small files into one before uploading.
- Scope paths and lower retention to stay lean.
Related guides
How to Reduce Docker Image Size for CIShrink CI Docker images with multi-stage builds, slim base images, .dockerignore, and fewer layers so pushes…
How to Measure CI DurationMeasure GitHub Actions duration accurately: queue time vs run time, per-job timing from the API, and trends o…
How to Find the Slowest Job in CIPinpoint the slowest job and step in a GitHub Actions workflow using the jobs API and step timings, so you op…
How to Measure and Cut Your CI BillMeasure your GitHub Actions bill by runner OS and workflow, find where minutes go, and cut spend with caching…