Auto deploy repo through github webhook
Created
May 6, 2020 03:37
-
-
Save garyhtou/b5f17e09142e8c9a97c1b170c29a2255 to your computer and use it in GitHub Desktop.
Auto deploy repo through github webhook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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