Build artifacts

Produce an artifact with a name

Lesson 6 of 20 · 12 min · Module 2: Gates and build outputs

Preserve the exact build output that later delivery steps should consume.

Start this lesson →

Free. No installation: you write and run the code in your browser, and it is checked automatically.

By the end, you’ll be able to…

  • Separate source from output
  • Name the artifact contract

The idea

A workflow combines an event boundary, job dependencies, and ordered steps. Conditions and prerequisite outcomes determine which jobs can run.

- uses: actions/upload-artifact@v4
  with:
    name: web-bundle
    path: build/

01Separate source from output

The repository is the input to a build. The artifact is its output, such as a compiled site directory. Later jobs should use that output deliberately.

02Name the artifact contract

The upload step needs both a name and a path. site is the identifier later jobs request; dist/ describes the output to preserve.

03Retain traceability

In a real pipeline, record the commit and build that produced an artifact. Rebuilding separately for production may produce something different from what was checked.

Your turn

Create build with checkout, npm ci, npm run build, and upload-artifact@v4. Upload dist/ as the artifact site.

What the checks look for

  • Builds before uploading
  • Stores site from dist/
Try it in the editor →

Take this with you

Define and preserve the build output as a delivery contract.

Go a little further

Add a build identifier to an artifact naming convention.

Learn CI/CD & Release Engineering for free

20 short lessons with real code and instant checks.

See the whole course →