Question

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?

Was it helpful?

Solution

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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top