Skip to content

Instantly share code, notes, and snippets.

@garyhtou
Created May 6, 2020 03:37
Show Gist options
  • Select an option

  • Save garyhtou/b5f17e09142e8c9a97c1b170c29a2255 to your computer and use it in GitHub Desktop.

Select an option

Save garyhtou/b5f17e09142e8c9a97c1b170c29a2255 to your computer and use it in GitHub Desktop.
Auto deploy repo through github webhook

Test-Auto-Deploy

Auto deploy repo through github webhook

<?php
// $key = 'abc';
// if ($_GET['key'] != $key){
// header('Location: ./');
// die();
// }
$pull_output = `git pull`;
$log_output = `git log`;
?>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>GITHUB DEPLOYMENT SCRIPT</title>
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Inconsolata&display=swap" rel="stylesheet">
</head>
<body style="background-color: #000000; color: #FFFFFF; font-weight: bold; padding: 0px 10px 0px 10px;">
<div style="">
<div style="">
<h1 style="color:white;font-family: 'Roboto', sans-serif;">GitHub Deployment Script</h1>
</div>
<div style="border-style:solid; border-color:gray; padding: 0px 10px 0px 10px">
<pre style="color: #63de00; font-family: 'Inconsolata';"><strong style="font-size:1.2em;">git pull</strong><br><br><?php echo $pull_output; ?></pre>
</div>
<br>
<div style="border-style:solid; border-color:gray; padding: 0px 10px 0px 10px">
<pre style="color: #63de00; font-family: 'Inconsolata';"><strong style="font-size:1.2em;">git log</strong><br><br><?php echo $log_output; ?></pre>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment