Skip to content
Latchkey

actions/upload-artifact: Persist Build Outputs

upload-artifact saves files from a job so you can download them or pass them between jobs.

Use it to keep test reports, build bundles, or coverage. v4 artifacts are immutable per name and download faster than v3.

Key inputs (with:)

  • name: artifact name (must be unique per run in v4).
  • path: file/dir globs to upload (required).
  • retention-days: how long to keep it (1-90).
  • if-no-files-found: warn, error, or ignore.
  • compression-level: 0-9 zip compression.

Example workflow

.github/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm run build
      - uses: actions/upload-artifact@v4
        with:
          name: dist
          path: dist/
          retention-days: 7

On any runner

Artifact upload works on any runner. Latchkey managed runners run it unchanged.

Key takeaways

  • Artifact names must be unique per run in v4.
  • Pair with download-artifact to pass files between jobs.
  • Tune retention-days to control storage usage.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →