deploy_feedback icon indicating copy to clipboard operation
deploy_feedback copied to clipboard

Deploy Hooks?

Open siygle opened this issue 2 years ago • 2 comments

Platforms like Vercel provide such a feature so we can do more flexible behavior based on the deployment status, is that possible Deno Deploy could also consider providing a similar one?

Thanks.

siygle avatar Mar 08 '23 07:03 siygle

For a Deno Deploy project that is deployed through GitHub Actions ("Build step with GitHub Actions"), I believe you should be able to add a webhook to the GitHub Action workflow.

https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch

vwkd avatar Jun 03 '23 18:06 vwkd

It would be useful and very developer friendly to be able to specify URLs in the deno.json that are hit after deployment.

Maybe a deploy prop, to allow future config too...

deno.json (just for example, I think the actual props need to be better thought out):

{
  "deploy": {
    "onSuccess": "/deployed", // resolved against the deployment URL, could also be absolute
    "onFail": "mailto:[email protected]", // also support mailto: for really simple email notifications instead

    // example of other potential options:
    "entrypoint": "main.ts"
  }
}

This avoids having to over-complicate the project with a CI specific build config, it would also work when using deployctl directly from cmdline or other CI and could potentially be adopted as a standard for all Deno hosting services, not just Deploy.

jollytoad avatar Sep 05 '23 08:09 jollytoad