The code in https://github.com/wmde/github-webhooks should be expanded as follows:
- have some configuration which repository names and which branches in those repositories should trigger a deployment. The configuration should map the repository name to a database file name
- Use the configuration in app/routes.php instead of the hardcoded repository and branch names. Suggestion: Create a class that is constructed with the configuration and has a method that accepts the webhook payload and returns a boolean, replacing/encapsulating the code in https://github.com/wmde/github-webhooks/blob/master/app/routes.php#L23-L26
- Change the files in the cli folder: each combination of repo and branch must use the right database file for the repo (again, using the configuration) and trigger a specific Ansible playbook and inventory combination. This can be achieved with individual cli scripts, like the current solution, or with one script that takes two parameters, or a combination (one cli for each repo).