Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Use Github Webhook to auto-deploy when a merge to master is performed #148

Open
codeofmochi opened this issue Mar 25, 2021 · 2 comments
Open
Assignees

Comments

@codeofmochi
Copy link
Collaborator

codeofmochi commented Mar 25, 2021

With webhooks, we can ask Github to push payloads to our server when a PR is merged to master: we could then automatically trigger the update script. Important considerations:

  • A web server will need to listen to these hooks anyway. Should it be part of the express instance itself (probably not a good idea, in terms of security and stability)? Or do we create another server instance but we then also have to setup docker or systemd etc. ?
  • Need to use a secret and secure the webhook server routes by verifying the secret hash sent by Github, see docs at https://docs.github.com/en/developers/webhooks-and-events/securing-your-webhooks

See docs at https://docs.github.com/en/developers/webhooks-and-events/webhooks

@s314cy s314cy self-assigned this Oct 24, 2021
@s314cy
Copy link
Contributor

s314cy commented Oct 25, 2021

The plan is to host a very simple Flask application running on some port, accessible at clic.epfl.ch/hooks/. The hook would trigger on pull requests (https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#webhook-payload-object-34) with action set to closed and merged to true. Obviously, the secret token's SHA256 must be checked before calling the right update scripts.

@codeofmochi
Copy link
Collaborator Author

Sounds good, but what about using another Node / Express server? This would ensure language consistency across the ecosystem

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants