Theme
Tier 4 · lesson 8 of 10 · 25 min

A pipeline for a machine with motors

You will: Design a deploy gate for a target that can physically move.

Builds on A release is a tag plus evidence.

Continuous deployment is a virtue for a web service. For a robot it is a hazard. The thing being updated has motors, and someone may be standing next to it. A robot that moves on every merged pull request is not a pipeline; it is an accident with a schedule.

So hardware deployment here is a separate workflow that can only be started by hand, and it has three gates, deliberately redundant:

  1. You type DEPLOY. A confirmation that a physical arm may move, not a checkbox.
  2. A GitHub Environment named robot requires a human reviewer before the deploy job may start. The point is a person deciding, so nothing automated approves it — including the AI tooling that helped write this project.
  3. The tag is resolved to a digest before approval. So a tag moved between "yes" and "deploy" cannot change what lands. What was approved is what ships.

Then the deploy itself is written to fail safe. It pulls before it stops the running container, so a slow or failed download never leaves a robot down. It waits on readiness, not liveness — liveness only says a process answered, while readiness says the robot can actually move. You will build both endpoints in Tier 5.

It has never run against hardware, because no arm exists. It fails at the SSH step, with an explanation. That is the correct behaviour: a deploy pipeline that reports success against nothing is worse than one that admits it cannot proceed.

In the simulation

GitHub's gates are not on this page, but the last line of defence is: the machine's own refusals. A joint will not pass its limit, a command for hardware that does not exist is refused out loud, and a move is done only when the arm has arrived and stopped, which is readiness, not liveness.

Kinematic: joints move at their real speed limit, but there is no gravity, no load and no physics. That is what the steps below are for.

The SO-101 loads as you reach it.

In this lesson

  1. Drive wrist_flex to its lower limit, -95°, and try to go further.
  2. Press w, the drive-forward key. The arm has no base, and it says so instead of pretending, as the deploy fails at SSH with no arm.
  3. Press h. This task completes only when every joint is home and the arm has stopped moving, not when the key was pressed.

Do it

  1. Find the three gates in the workflow.

    grep -n -E "DEPLOY|environment:|digest" .github/workflows/hardware-deploy.yml
    
  2. Find the order of operations on the robot — pull, remove the old container, run, wait.

    grep -n -E "docker pull|docker rm|docker run|readyz" .github/workflows/hardware-deploy.yml
    
  3. On your own copy, run the workflow from the Actions tab without typing DEPLOY, and read how it refuses.

You will know it worked when: You can name the three gates, and say what each one protects against that the other two do not.

When it goes wrong

A deploy "succeeded" and the robot is not doing anything.

Why: The deploy waited on liveness — the process answered — rather than readiness.

Fix: Gate on readiness. Tier 5 builds the endpoint and explains the difference.

Terms

Approval gate
A step a deploy cannot pass without a human decision — here, a required reviewer on a GitHub Environment.
Pull before stop
Downloading the new image before stopping the old container, so a failed download leaves the old version running.

Every term in the course: glossary.

Check yourself

Answer in your head first, then open it.

Why resolve the tag to a digest before approval rather than after?

The reviewer approves a specific artefact. If the digest were resolved afterwards, the tag could move in between and something unreviewed would ship.

Why is failing at the SSH step, with no robot, the right behaviour?

Reporting success against nothing would teach everyone that a green deploy means nothing. Failing honestly keeps green meaningful.

Stretch

Pick the riskiest deploy you are responsible for at work. Write its gate in the same shape: what a human must type, who must approve, what is pinned before approval, and what the deploy waits on before calling itself done.

Going deeper