A deployment artifact is the complete tested output that will run on the server. Building it once reduces differences between a reviewed release and what production actually receives.
IN THIS ARTICLE
Check access and requirements
Identify the application’s runtime, lock files, build commands and required output. Decide which environment values belong at build time and which remain runtime secrets.
01 Build a deployment artifact in CI
Start from the intended commit in a clean build environment. Use the supported runtime and install dependencies from reviewed lock files.
Run the necessary build and meaningful checks. Include generated assets, runtime dependencies and files the application loads dynamically.
Exclude local secrets, unrelated source archives, development databases and temporary logs. Review native dependency compatibility with the target platform.
Package the output and record a checksum together with the commit and build identifier. Keep that package immutable after validation.
Deploy the same reviewed artifact to the intended release directory and supply runtime configuration through its protected mechanism.
02 Example: attach a release manifest to one reviewed artifact
In a clean CI workspace, build the application and generate a small manifest beside the packaged release. Use the real commit and checksum produced by your pipeline. The illustrative values below show the information to retain, not a valid checksum for an existing download.
{
"release": "example-2026-10-05.1",
"commit": "REPLACE_WITH_FULL_COMMIT_ID",
"artifact": "release.tar.gz",
"sha256": "REPLACE_WITH_COMPUTED_SHA256",
"build_command": "npm run build",
"runtime": "PROJECT_APPROVED_NODE_VERSION"
}
Store the archive and manifest together, then deploy that same archive to staging and production after review. Keep runtime secrets outside both files. For native dependencies, record the target platform too, since a Linux package and a laptop build may not be interchangeable.
Expected result: The deployed artifact’s checksum matches the reviewed archive, its commit is traceable, and a clean startup succeeds without files borrowed from the original CI workspace.
Confirm the expected result
Start the artifact in a clean environment without relying on the build workspace. Verify the release identifier and checksum at the destination.
Resolve setup problems
If a file exists only on the developer laptop or CI workspace, add it to the deliberate build process. Copying an extra file manually may fix one deployment but leave the next release broken.
A common question
Should the server rebuild everything again after upload?
Choose one controlled build strategy. If the server performs a required target-specific build, record and test that stage explicitly rather than assuming it matches an earlier unrelated artifact.