Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sync Github Repo to Dreamhost Site

I want to host a website with Dreamhost whose files are editable via Github such that when commits are pushed to Github the actual website updates. How can I best achieve this? Dreamhost offers Subversion as a one-click install. For git it gives cautionary advice. I prefer git over Subversion. Syncing git to Subversion seems viable. Where in the directory structure would Subversion need to be installed in order to have the site display the content (not the repo)? Recommendations?

like image 325
ryanve Avatar asked Jun 25 '13 00:06

ryanve


1 Answers

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 in deploy.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 the SECRET_ACCESS_TOKEN.
  • In deploy.php use URI-safe characters for the SECRET_ACCESS_TOKEN b/c it gets used as a query parameter.
like image 82
ryanve Avatar answered Sep 30 '22 14:09

ryanve