35 min·advanced

Lesson 6

Deployment & Git workflow

Build a practical mental model for deployment & git workflow and use it in working JavaScript.

By the end, you will be able to…

  • Explain deployment & git workflow in your own words
  • Use deployment & git workflow in a small program
  • Recognize and debug a common failure mode

Build the mental model

A deployment pipeline runs the same checks — install, lint, test, build — on every change before it ships, removing 'works on my machine' from the equation entirely.

Syntax and working example

Read the code from inputs to output. Predict what it prints, then run it and change one value.

Working example
Expected output: Every change is verified the same way before it reaches production

Why this matters

Automating verification catches regressions before users ever see them, and makes shipping routine instead of stressful.

Real-world example

This platform's own GitHub Actions workflow runs exactly this install-lint-test-build sequence on every pull request.

Common mistakes

  • Deploying directly from a local machine without running the same checks CI would run
  • Skipping tests locally and only discovering failures after pushing
  • Deploying straight to production without a review step

Try it yourself

Challenge

Write a function that returns whether a build should be allowed to deploy, given check results.

Practice

Knowledge check

What is the main purpose of running lint/test/build in CI on every pull request?

Summary

Automate install, lint, test, and build on every change so shipping is routine and verified, not risky.