Release gates, asset paths and deployment
Quick answer
A release pipeline should install reviewed dependencies, check source and tests, build once, and verify the same immutable artifact intended for deployment. Static hosting also needs correct asset paths and route behavior.
Tooling examples
Example 1. Context: projects/npm-lab. Run in a fresh prepared fixture copy; see its README. Local check available; consult validation evidence for what was asserted.
npm run --silent gateExpected observation: gate test passed gate artifact verified
Example 2. Context: projects/npm-lab. Run in a fresh prepared fixture copy; see its README. Local check available; consult validation evidence for what was asserted.
npm run --silent gate:failExpected observation: gate test failed; nonzero exit; artifact verification does not run.
How the tooling works
For an app served under /notebooks/, configure Vite base accordingly so generated asset references target that mount point. A history-based SPA needs appropriate host fallback for navigation routes without turning missing asset requests into successful HTML responses. A preview is not production verification. Keep secrets server-side, publish only the approved artifact, and preserve the prior release for rollback. In npm-lab, npm run gate uses shell && to stop after a failing test, then performs a small local verification; this is not a real hosted deployment.
Common mistakes
Do not rebuild an unreviewed artifact after approval or deploy source credentials. Verify the exact output and its host configuration.
Practice
Run the local gate and verify a failing first stage stops later commands. In a separate Vite environment verify the deployed base path and missing-asset behavior.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Release gates, asset paths and deployment — Knowledge Check
Assess tooling contracts, diagnostic reasoning and transfer to a project.
What should a release pipeline do after a mandatory test fails?
What does a Vite base path configure?
Why verify the exact artifact that will be deployed?
In Release gates, asset paths and deployment, what is the expected observation for example 1 in its documented setup? npm run --silent gate
In Release gates, asset paths and deployment, what is the expected observation for example 2 in its documented setup? npm run --silent gate:fail