> ## Documentation Index
> Fetch the complete documentation index at: https://libops-renovate-github-com-libops-sitectl-0-x.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# deploy

> Pull updates and restart services for the active context.

Use `deploy` to apply a full update cycle to a running site — pull the latest code, update images, and restart services. It handles the down/pull/up sequence in the correct order, including any plugin-registered hooks.

## Reference

Deploy the active context by orchestrating a full update cycle.

The deploy sequence runs:

1. Plugin pre-down hooks (if the context plugin registers a deploy runner)
2. docker compose down
3. git fetch and git checkout `<branch>` (unless `--skip-git` is set)
4. docker compose pull (unless `--no-pull` is set)
5. docker compose up -d `--remove-orphans`
6. Plugin post-up hooks (if the context plugin registers a deploy runner)

The `--branch` flag overrides which branch is checked out during the git step.
If omitted, the repository's current branch is updated via fetch without switching.

Examples:
sitectl deploy                         # Deploy current branch on active context
sitectl deploy `--branch` main           # Switch to main and deploy
sitectl deploy `--skip-git`              # Restart services without pulling git changes
sitectl deploy `--context` prod          # Deploy on a specific context

```bash theme={null}
sitectl deploy
```

| Flag         | Default | Description                                                                |
| ------------ | ------- | -------------------------------------------------------------------------- |
| `--branch`   |         | Git branch to check out during the deploy (default: update current branch) |
| `--no-pull`  | `false` | Skip docker compose pull before bringing services up                       |
| `--skip-git` | `false` | Skip the git fetch/checkout step                                           |

## Deploy sequence

1. Plugin pre-down hooks (if the context plugin registers a deploy runner)
2. `docker compose down`
3. `git fetch` and `git checkout <branch>` (skipped with `--skip-git`)
4. `docker compose pull` (skipped with `--no-pull`)
5. `docker compose up -d --remove-orphans`
6. Plugin post-up hooks

## Common workflows

```bash theme={null}
# Standard deploy on the active context
sitectl deploy

# Deploy a specific branch
sitectl deploy --branch main

# Restart services without pulling git changes (e.g. after a config change)
sitectl deploy --skip-git

# Deploy on a non-active context
sitectl deploy --context prod
```
