A deployment builds your code into a new release and puts it in place of the one that is running. You can follow each one on the project's Deployments tab, cancel it while it runs, and look back through the history.
Start a deploy
Click Deploy in the project header. The projects list has the same button on each row, labelled Redeploy when the project's last deploy failed. A push to the project's branch on GitHub starts a deploy too (see Deploy from GitHub), and a zip project is redeployed with Redeploy with new zip under Settings (see Deploy from a zip file).
Owners, admins and members can deploy. A viewer who tries gets "Your role in this organization can't start deploys. Ask an admin to deploy, or to change your role."
A deploy uses the settings and environment variables that were saved when it started. Anything you save after that waits for the next deploy.
What a deploy goes through
The Deployments tab shows each deployment's status:
| Status | What is happening |
|---|---|
| Queued | Waiting for a build slot, or fetching your source |
| Building | The build runs and the finished image is saved |
| Deploying | The new release starts and HCode checks that it answers |
| Success | The new release is live |
| Failed | Something went wrong; open the row to see what |
| Cancelled | You cancelled it, or a newer deploy replaced it |
On a new project's Overview page, the first deploy shows the same journey as three steps: Queued, Building and Verifying.
The check before a release goes live
For a web app, HCode requests the root of the project's generated address until it gets two answers in a row from your app. A 2xx, 3xx or 4xx status passes and a 5xx fails, as do framework error pages such as Django's "Bad Request (400)". If you set a Health check path (optional), that check has to pass as well. Web apps and workers has the details, and App won't start lists the messages a failed check produces.
A background worker has no address to check. Its deploy fails if the process exits instead of staying up.
Downtime during a deploy
When the project already has a running release, the new release starts before the old one stops, so visitors keep getting answers.
If the new release fails its check, HCode puts the previous release back and the project stays running. A first deploy has nothing to fall back to. While it is failed, the generated address shows a page saying "This app isn't running".
Several deploys at once
The newest deploy wins. A new deploy cancels one that is still queued or building. Once the earlier build has finished and its image is being saved or rolled out, the new one waits for it instead. A second deploy of the same commit with no changed settings is not started while the first one is still running.
Your plan allows a set number of builds to run at the same time across the organisation. A deploy over that number is accepted and waits its turn, with a message such as "Queued — starts when your running build finishes." Waiting deploys start in the order they were queued. Build time counts toward your build minutes.
Cancel a deploy
- While a deploy is running, click Cancel deploy in the project header.
- Click Cancel deployment in the dialog, or Keep it running to leave it alone.
Cancelling stops the build or the rollout. If the project has a healthy release, that release keeps serving and the project shows as running. If it has none, the project ends up stopped. A cancelled first deploy shows "It stopped before your app went live, so nothing is running yet. Deploy again when you're ready." with a Deploy again button.
Deployment history
The Deployments tab lists the project's latest 100 deployments, newest first. Each row shows the status, the commit message (or "Manual deployment"), the short commit hash, the branch, what started it ("Manual", "Git push", "Rollback" or "Automatic"), when it started and how long it took. The list refreshes every 5 seconds while a deploy is running and every 15 seconds otherwise, and Refresh reloads it straight away.
Click a row to open it:
- The build log loads underneath. See Build logs.
- A failed deployment shows "What went wrong" with HCode's diagnosis, a "Last output" box when the app printed something before it stopped, and the raw error under Technical details. Failed deploys explains the messages.
- A successful deployment that HCode still keeps has Rollback to this version. Older ones say they can no longer be rolled back to. See Roll back a deployment.
If HCode corrected something during the deploy, such as the folder a static site is served from, the row shows "What changed" and "This was corrected automatically by hcode before the deployment finished."