Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying a test web app for each GitHub pull request

Is it possible for GitHub to trigger a new test deployment when a pull request is submitted? I'd like for it to create a new folder on the server (Azure preferred) so that a test URL (e.g. http://testserver.com/PR602/) is generated that we can refer to in the pull request.

This would allow anyone to test a pull request without having to clone the repo, check out the branch, and build it locally.

In my initial research I found that Travis CI can deploy all branches, but I'm not clear how this would be triggered. Do I have to write a custom app that's triggered by pull request web hooks? I'm hoping someone has discovered a simpler method.

like image 860
Mike Wheaton Avatar asked Jun 19 '26 12:06

Mike Wheaton


1 Answers

Do I have to write a custom app that's triggered by pull request web hooks?

Yes, or find someone else who has happened to have written the exact webhook handler you need.

Writing a webhook handler isn't terribly much work. If you don't want to integrate it with your current app, you can use a micro-framework like Flask to do this in only a few lines of code.


Coming back to this in 2022, there is now also the option of Github Actions, which is a first-party CI service. Actions provides a framework for defining what things to do when certain triggers happen, and there's an extensive marketplace of drop-in components, so you may be able to do all of your triggering of other systems without writing any custom code or running a webserver to listen to webhooks.

like image 184
Xiong Chiamiov Avatar answered Jun 23 '26 00:06

Xiong Chiamiov