Deploy
Parse Arguments
Arguments: $ARGUMENTS
staging(default): deploy withfly.staging.tomlproduction: deploy to staging first, then promote the same image withfly.production.toml
Refuse any other argument.
Prerequisites
The fly CLI is installed and logged in (fly auth whoami succeeds).
Steps
Stop and report the failing command if any step exits non-zero.
- Run the
testskill. - Run
fly deploy --config fly.staging.toml. Fly builds the image fromDockerfile(which runsnpm run build), starts the new machines beside the old ones (strategy = "bluegreen"in each fly config), and switches traffic only after every new machine passes its/healthcheck, so a failed check leaves the previous release serving. - For
productiononly: promote the image staging just verified. Read it withfly image show --config fly.staging.toml, then runfly deploy --config fly.production.toml --image <that image>. - Report the environment, the released version from
fly releases --config fly.<environment>.toml, and the deploy result.