Last updated on 12th June 2026

How to set up automatic deployments with DeployHQ’s GitHub Action

If you wish to use GitHub Actions for your DeployHQ automatic deployments, you can add our deployhq-action to your repository, and set it up in a couple of minutes. The action installs the official dhq CLI on the GitHub runner, triggers your deployment, waits for it to finish, and fails the job if the deploy didn’t succeed — so you get real status back in your workflow run instead of fire-and-forget.

You will need to add three secrets to your GitHub repository under “Settings >> Secrets and variables >> Actions”:

  • DEPLOYHQ_API_KEY (required): A DeployHQ API key. Generate one under “Account Settings >> API access”.
  • DEPLOYHQ_ACCOUNT (required): Your DeployHQ account subdomain (e.g. acme for acme.deployhq.com).
  • DEPLOYHQ_EMAIL (required): The email address of the DeployHQ user that owns the API key.

With these secrets added, copy the following YAML into your repository under .github/workflows/deploy.yml, replacing my-project and production with your project’s permalink and the server you want to deploy to:

name: Deploy to DeployHQ
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger DeployHQ deployment
        uses: deployhq/deployhq-action@v2
        with:
          api-key: ${{ secrets.DEPLOYHQ_API_KEY }}
          account: ${{ secrets.DEPLOYHQ_ACCOUNT }}
          email:   ${{ secrets.DEPLOYHQ_EMAIL }}
          project: my-project
          server:  production

More details on workflow file syntax can be found here.

Once set up, make sure to delete the DeployHQ webhook which was added automatically to your GitHub repository at the time of creation of your DeployHQ project, located in your GitHub repository under “Settings >> Webhooks”.

Location of the GitHub repository webhooks

Not doing so may cause a “double deployment”, as a push to your repository will trigger both the integrated webhook in your GitHub repository, as well as the deployhq-action GitHub Action.

Once this is set up, you should be able to trigger automatic deployments to your desired server directly through the GitHub Action.

For the full list of inputs (branch, revision, wait, dry-run, timeout, etc.) and the migration guide from the previous webhook-based action, see the GitHub README.md. If you’re not ready to migrate, the legacy webhook-based action is still available — pin deployhq/deployhq-action@v1 and follow the v1 documentation.