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?
Asked
Active
Viewed 4,475 times
5
-
do you have ssh access to your server? – Chronial Jun 25 '13 at 01:43
-
@Chronial Yes SSH access is possible in Dreamhost. – ryanve Jun 25 '13 at 01:58
-
1then just follow the tutorial given on the site you linked. Set up a repo on the server and push to it. Make sure that git is installed, first. – Chronial Jun 25 '13 at 02:13
-
@Chronial Then I guess you mean the SSH method is better than the Webdav. Basically I want to figure out the setup that's least likely to be problematic. The `post-receive` hooks looks like what I need for the actual display. – ryanve Jun 25 '13 at 14:05
-
1No – all you need to do is: ssh to the server, run `git init --bare .` in an empty dir and run `git clone ssh://myserver/path/to/dir` on your client. Done. (as long as git is installed on the server) – Chronial Jun 25 '13 at 15:00
-
@Chronial Thanks for clarifying. I got it to work without needing to create an extra repo. See answer below. – ryanve Jun 25 '13 at 19:11
1 Answers
6
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.

ryanve
- 50,076
- 30
- 102
- 137
-
I know this is a bit late, but I am trying to get this to work with my Dreamhost account. I have the deploy.php file setup and when I go to the URL it is at it seems to be working. For some reason the files aren't updating on the server when I push changes to GitHub. Any idea why? I have the web hook in place. – Andrew Jul 16 '13 at 02:40
-
@Andrew If you go directly to the hook URL on your site (/deploy.php?sat=...) does it show errors? – ryanve Jul 16 '13 at 19:39
-
It doesn't, that is why I am confused. Anything else that could be wrong? – Andrew Jul 16 '13 at 19:46
-
-
I'm having a similar issue. If I go directly to deploy.php myself it works, but the webhook is giving a "service timeout" issue. – aslum Jul 22 '15 at 17:09