Skip to content
Latchkey

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: 9

Bundle 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

Run this faster and cheaper on Latchkey managed runners. Start free →