Sync Github Replication with Dreamhost

I want to host a website with Dreamhost , whose files can be edited via Github , so when commits are transferred to Github to the actual website updates. How can i achieve this? Dreamhost offers Subversion how to install one click. For git, he gives warning advice . I prefer git over Subversion. Git to Subversion sync seems viable. Where in the Subversion directory structure is it necessary to set the site to display content (rather than repo)? Recommendations?

+4
source share
1 answer

I got it to work using simple-php-git-deploy . No additional repo is required. Github post-receive intercepts the Github repository, notifying deploy.php on the server to deploy the changes. For editing, you need only a few lines in deploy.php . survitals.com is updated when I click on its Github repository.

  • For Dreamhost, the TARGET_DIR defined in deploy.php should be like /home/user/example.com/ .
  • It allows you to have files on the server that are not in the repo. For security, I omitted deploy.php myself from Github because it shows SECRET_ACCESS_TOKEN .
  • In deploy.php use URI-safe characters for SECRET_ACCESS_TOKEN b / c, which is used as the request parameter.
+5
source

Source: https://habr.com/ru/post/1487980/


All Articles