Skip to content
Hoist

Deploy hooks

A deploy hook is a secret URL that deploys the latest commit on the project's production branch when it receives a POST. Use one from CI, a CMS publish button, or a cron job, when a push alone isn't the right moment to deploy.

Creating a hook

Go to the project's Settings → Deploy hooks and create one. Give it a name that says where it's used, such as "GitHub Actions" or "CMS".

Copy the URL straight away: it isn't shown again. Anyone with it can deploy the project, so keep it in your CI's secrets, not in your repository. If it leaks, delete the hook and create a new one.

Each hook shows when it was created and when it was last used. Admins and owners manage deploy hooks.

Calling a hook

Send an empty POST:

curl -X POST "$HOIST_DEPLOY_HOOK"

A started deploy answers 202 with the deployment:

{
  "deployment": {
    "number": 42,
    "status": "queued",
    "commit": "a1c9e4f…",
    "url": "https://hoist.irdc.ph/teams/…/deployments/42"
  }
}

Other answers:

  • 404: the hook doesn't exist, or was deleted.
  • 409: the deploy couldn't start, for example during a deploy freeze. The body's message says why.
  • 429: too many calls. Each hook can be called 10 times a minute.

From GitHub Actions

Turn off auto-deploy in the project's Settings → General, then deploy from the end of your workflow, once the tests pass:

- name: Deploy
  run: curl --fail -X POST "${{ secrets.HOIST_DEPLOY_HOOK }}"