I got it to work using simple-php-git-deploy. No extra repo needed. Github post-receive hooks on the Github repo notify the deploy.php file on the server to deploy the changes. There's just a few lines in deploy.php
to edit. survitals.com updates when I push to its Github repo.
- For Dreamhost the
TARGET_DIR
defined indeploy.php
needed to be like/home/user/example.com/
. - It lets you to have files on the server that are not in the repo. For security I omitted
deploy.php
itself from Github because it shows theSECRET_ACCESS_TOKEN
. - In
deploy.php
use URI-safe characters for theSECRET_ACCESS_TOKEN
b/c it gets used as a query parameter.