---
title: Tracking deployments
description: Track deployments from Ruby applications to correlate errors with releases and identify problematic code changes.
url: https://docs.honeybadger.io/lib/ruby/errors/tracking-deployments/
---

Honeybadger has an API to keep track of project deployments. Whenever you deploy, all errors for that environment will be resolved automatically. You can choose to enable or disable the auto-resolve feature from your Honeybadger project settings page.

## Deploying with GitHub Actions

If your CI/CD pipeline is hosted with GitHub Actions, you can use the [Honeybadger Deploy Action](https://github.com/marketplace/actions/honeybadger-deploy-action) to notify our API about deployments.

## Deployment tracking via command line

We provide a CLI command to send deployment notifications manually. Try the following command for the available options:

```sh
bundle exec honeybadger help deploy
```

Here’s an example of using the CLI to send a deployment notification:

```sh
bundle exec honeybadger deploy \
  --repository https://github.com/myorganization/myrepo \
  --revision $(cat REVISION) \
  --environment production \
  --user $(whoami)
```

## Heroku deployment tracking

Deploy tracking via Heroku is implemented using Heroku’s [app webhooks](https://devcenter.heroku.com/articles/app-webhooks). To set up the webhook, run the following CLI command from your project root:

```sh
bundle exec honeybadger heroku install_deploy_notification
```

If the honeybadger CLI command fails for whatever reason, you can add the deploy hook manually by running:

```sh
heroku webhooks:add -i api:release -l notify -u "https://api.honeybadger.io/v1/deploys/heroku?repository=git@github.com/username/projectname&environment=production&api_key=asdf" --app app-name
```

If you are using our EU stack, you should use `eu-api.honeybadger.io` instead of `api.honeybadger.io` in the webhook URL.

For more about manual use of Heroku deploy tracking, see the [Heroku Deployments](https://docs.honeybadger.io/guides/heroku/#heroku-deployment-tracking) guide.

You should replace the `repository`, `api_key`, and `app` options with your own values. You may also want to change the environment (set to production by default).

## Kamal deployment tracking

You can use Kamal’s post-deploy hook to send a deployment notification to Honeybadger. Add the following snippet to `.kamal/hooks/post-deploy`:

```bash
bundle exec honeybadger deploy \
  --repository https://github.com/your_org/your_repo \
  --revision $KAMAL_VERSION \
  --environment production \
  --user $KAMAL_PERFORMER
```

## Capistrano deployment tracking

In order to track deployments using Capistrano, simply require Honeybadger’s Capistrano task in your `Capfile` file:

```ruby
require "capistrano/honeybadger"
```

If you ran the `honeybadger install` command in a project that was previously configured with Capistrano, we already added this for you.

Adding options to your *config/deploy.rb* file allows you to customize how the deploy task is executed. The syntax for setting them looks like this:

```ruby
set :honeybadger_env, "preprod"
```

You can use any of the following options when configuring capistrano.

| Option                        |                                                                                                                                                    |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `honeybadger_user`            | Honeybadger will report the name of the local user who is deploying (using `whoami` or equivalent). Use this option to to report a different user. |
| `honeybadger_env`             | Honeybadger reports the environment supplied by capistrano by default. Use this option to change the reported environment.                         |
| `honeybadger_api_key`         | Honeybadger uses your configured API key by default. Use this option to override.                                                                  |
| `honeybadger_async_notify`    | Run deploy notification task asynchronously using `nohup`. True or False. Defaults to false.                                                       |
| `honeybadger_server`          | The api endpoint that receives the deployment notification.                                                                                        |
| `honeybadger`                 | The name of the honeybadger executable. Default: “honeybadger”                                                                                     |
| `honeybadger_skip_rails_load` | Skip loading the Rails environment during deploy notification.                                                                                     |

## Ruby deployment tracking

You can also track a deployment from the *honeybadger* Ruby gem with `Honeybadger.track_deployment`:

```ruby
Honeybadger.track_deployment(
  environment: Rails.env,
  revision: `git rev-parse HEAD`.strip,
  local_username: `whoami`.strip,
  repository: "git@github.com:user/example.git"
)
```

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
