I did something very similar for handling webhooks (but can also be used for anything else), check it out at https://github.com/adnanh/webhook
People have used it in various segments, from actual deployments on push, to home automation, someone even wrote a guide on how to control the Xiaomi Robot Vacuum using the Amazon Dash button :-)