> ## Documentation Index
> Fetch the complete documentation index at: https://archie.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployments

> Deploy a service, compare Head with the live version, read the deploy pipeline step by step, and find out why a deploy failed. Redeploy an earlier commit when you need to go back.

A deploy builds the service's latest commit and runs it through a pipeline. When every step passes, that commit becomes the **Live version**.

## Deploy a service

Click **Deploy** in the service header. The header shows **Deploying** and the progress, such as **Deploying · 5/17**, while the pipeline runs. You can keep working. Only one deploy runs at a time, so starting another while one is running shows the existing one.

Each deploy builds **Head**, the latest commit. If you edited files, [save them](https://archie.com/docs/backend/logic/working-with-a-service.md#save-and-commit) first. Changes you haven't saved aren't deployed.

A failed deploy never replaces the live version. The service keeps running the last good commit.

## Deployment history

Open the **Deployments** tab. The number next to the tab is the count of deploys for this service.

![The Deployments tab with the deploy list on the left and a failed deploy open on the right, showing the failed step and the pipeline.](https://mintcdn.com/archie-e998dbf6/FcInvfd50seksJIy/images/35-logic-deployments.png?fit=max\&auto=format\&n=FcInvfd50seksJIy\&q=85\&s=e1357d5c5edf4d4989a014441a811411)

The list on the left groups deploys by day and shows, for each one:

* The commit message and the short commit hash.
* Who started it and the time.
* The trigger, such as **Manual**.
* The duration.
* A **Live** label on the deploy that's running now.

At the top of the list, a summary reads like "14 deploys · median 2m 15s". Use **All** and **Failed** to filter the list.

Select a deploy to see its details on the right.

### Deploy states

| State | What it means |
| - | - |
| **Queued** | The deploy is waiting to start. |
| **Deploying** | The pipeline is running. The details show the current step. |
| **Succeeded** with **Live** | This commit is running now. |
| **Succeeded** with **Superseded** | This deploy succeeded, and a newer deploy has since replaced it. |
| **Deployed with N warnings** | The deploy finished and the service is live, but one or more steps reported a warning. |
| **Failed** | A step failed. The details name it, such as **Failed at Build image**. |

A successful deploy shows how long it was live and how it compares to the median, for example "16.3s faster than the median".

## The deploy pipeline

Every deploy runs the same steps, grouped into four stages. A successful run shows **17 passed**.

![A successful deploy showing Succeeded and Live, the commit, the trigger, the environment, and the first stages of the pipeline.](https://mintcdn.com/archie-e998dbf6/FcInvfd50seksJIy/images/36-logic-deployment-succeeded.png?fit=max\&auto=format\&n=FcInvfd50seksJIy\&q=85\&s=ba25350980329c19cfb16acfe639e79e)

| Stage | Steps |
| - | - |
| **Source** | Fetch source, Detect language and download, Load environment variables, Runnability check. |
| **Build** | Build image, Upload build context, Push image. |
| **Release** | Deploy workload, Health check, Update footprint, Register API, Reconcile GraphQL schema. |
| **Finalize** | Record job details, Refresh cache, Record status, Notify completion, Clean up. |

Some points about specific steps:

* **Load environment variables** reads the environment's [variables and secrets](https://archie.com/docs/backend/logic/environment-variables.md) for this deploy.
* **Register API** and **Reconcile GraphQL schema** add the service's operations to your project's API. After a deploy, they appear in the [GraphQL API Explorer](https://archie.com/docs/backend/graphql-api-explorer.md).
* If a step finishes with a warning, the deploy continues. Open the logs for that step to read the details.

If a step after a failure doesn't run, it shows **Skipped**.

## When a deploy fails

A failed deploy shows the stage and step that failed, for example **Failed at Build image · step 5 of 17**, and a red progress bar. Below it, Archie reminds you: "Nothing changed for your users: a2afeb1 is still live."

To find the cause:

1. Select the failed deploy in the list.
2. Find the red step in the **Pipeline** and read its message. For a build failure, it reads "This step failed. Open the environment logs for details."
3. Click **View logs** to read the logs for the deploy. See also [Logs](https://archie.com/docs/backend/logs.md).
4. Fix the code in the **Code** tab and click **Save**.
5. Click **Deploy**.

If the failure looks temporary, click **Retry deploy** on the failed deploy to run it again without changing anything.

### The GraphQL schema warning

If the **Reconcile GraphQL schema** step can't finish, Archie still deploys the service. The service answers requests at its endpoint, but new operations may be missing from the API and from the API Explorer. Redeploying usually fixes it.

## Redeploy an earlier commit

To go back to a version that worked, open an earlier successful deploy and click **Redeploy this commit**. Archie asks you to confirm.

![The Redeploy confirmation dialog reading "This builds and deploys commit 89fbd20 again. When it is healthy it replaces the live version a2afeb1."](https://mintcdn.com/archie-e998dbf6/FcInvfd50seksJIy/images/39-logic-redeploy-dialog.png?fit=max\&auto=format\&n=FcInvfd50seksJIy\&q=85\&s=661ecbf20a2bd8127f587cacd74587a8)

Archie builds and deploys that commit again. When it's healthy, it replaces the live version. The commit itself isn't rewritten: Head still points at your latest commit and shows **Undeployed changes** until you deploy it.

## Deploys and environments

Each deploy lists the **Environment** it ran in, such as `master`. The service list and its deploy history are scoped to the environment selected in the Backend Console. If a service doesn't appear after you switch environments, it belongs to another one. See [Environments](https://archie.com/docs/backend/environments.md).

## FAQ

> **Do I need to deploy after every save?**
>
> No. Saving commits your change. Deploy when you're ready for the change to go live. You can save several times and deploy once.

> **What happens to users while a deploy runs?**
>
> The current live version keeps running. It's replaced only when the new deploy is healthy.

> **What if I click Deploy while a deploy is running?**
>
> Only one deploy runs at a time. Archie tells you "A deploy was already running" and shows its progress instead of starting a second one.

> **How long does a deploy take?**
>
> It depends on the service. The deploy list shows a median for your own deploys. In the example above, the median is 2m 15s, and most of the time goes to the **Build image** step.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.