Node.js DeploymentLesson 80Free preview
Node CI/CD
This lesson is part of Node.js · All levels
Summary
This lesson introduces CI/CD to the Node.js project: an automated stream builds, tests, and releases applications whenever there is a change in code. You'll learn the concept of continuous integration with pipeline (e.g. GitHub Actions), runs npm ci, tests, and coverage, and then automatically deploys to the server. This automation suppresses manual release errors.
Key points
- CI runs automated build and test on each PR; CD takes care of automated deployments.
- Npm ci is preferred in CI than npm install due to the reproductive of package-lock.json.
- General pipeline: checkout → setup Node → npm ci → lint → test → build → deploy.
- Keep the cache dependency (e.g. actions/cache) to speed up the pipeline.
- Use the secret manager for your credentials, don't write it on file.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.