Skip to content
Latchkey

How to Upload a Build Artifact in GitHub Actions

actions/upload-artifact@v4 zips a path and stores it against the run so you can download it later.

Add a step with actions/upload-artifact@v4, set name: to identify the artifact, and set path: to the file or directory to keep.

Steps

  • Build the output you want to persist (for example dist/).
  • Add actions/upload-artifact@v4 with a name: and a path:.
  • Open the run summary to download the zipped artifact.

Workflow

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

Gotchas

  • v4 stores each artifact as an immutable zip; the name must be unique within a run.
  • The artifact appears under the run summary once the job finishes, not mid-run.

Related guides

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