GuidesAuto-deploy from GitHub
Deploy with a deploy hook
With a deploy hook, your CI deploys one service after the tests pass.
You push a commit. Your CI runs the tests.
1 / 4
A deploy hook is a secret URL that deploys one service when you call it. Use it from your CI, or from each tool that can send an HTTP request. The server needs no webhook secret for it.
Call the hook
Terminal
$ ferry deploy-hook show apihttps://ferry.apps.example.com/hooks/deploy/srv-5c57d756f6ad47f59800?key=652f4935c8534c02aad20d953d8a7ff1$ curl -X POST 'https://ferry.apps.example.com/hooks/deploy/srv-5c57d756f6ad47f59800?key=652f4935c8534c02aad20d953d8a7ff1'The rules
POSTandGETwork. The answer is202, with a summary of the deploy in the queue (triggerdeploy_hook).- The hook deploys the source in the settings of the service: the head of its branch, its image, or its last upload. It cannot choose a commit.
- The URL is the secret. Store it as a secret of your CI.
ferry deploy-hook rotate apireplaces the key. The old URL stops immediately.- The printed URL starts with the server URL of your CLI. From outside, call it on your public dashboard host.
An unknown service id and a wrong key get the same answer: 401. Thus nobody can use the hook to find services. A suspended service answers 409.
If the image has the tag latest or no tag, Ferry pulls it again.
See Deploy hooks and the Webhooks API.