I am wanting to move all of my sites to GitHub for all of the obvious benefits. I am not a big fan of the command line, so I like GitHub because it allows me to avoid touching all of that. Setting up a repository on GitHub and then syncing it with my computer is easy enough. I need to be able to push from GitHub to the webserver automatically though so when I update something locally to the main branch, sync it with GitHub, it goes live on the site. From Googling the subject it seems like most of the techniques either require the command line or seem fairly complex. I want to do this with about 15-20 sites (many of which are hosted on different servers from different clients). I want to find an option that is within my skill set and doesn't take 2-3 hours per site. Anyone know of the best, easiest way to set this up?
相关问题
- How to add working directory to deployment in GitH
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
相关文章
- 请教Git如何克隆本地库?
- java开发bug问题:GitHub授权登录无法获取授权账号信息?
- Is there a Github markdown language identifier for
- “no implicit conversion of Integer into String” er
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
I know this ticket is old, but for those who find this somehow, checkout dploy.io. It's a hosted service made specifically for the purpose of deploying your repo from GitHub/Bitbucket to your server. It supports SFTP/FTP/S3/Heroku/SSH commands and more.
Disclaimer: I work on dploy.io
The part which is complex is the webhook on GitHub
That means your web site must have a process listening to those JSON messages sent by GitHub upon reception of a commit.
You can see multiple examples of those listeners, like this webhook-deployer, with an auto.php (for a php server):
That GitHub project recommends an SSH key with no passphrase, which I agree at first (to test it out).
However, especially for private projects, it is best to run an ssh-agent and manage an ssh key passphrase protected.
As janos comments:
You might want to take a look at this PHP script:
https://github.com/JohannesHoppe/easy-git-deploy
(It does a git clone, git pull, git push for you)
Since several years I manage all my wordpress installations with that script.
Hint: If you are using a shared hosting environment, than script limits might break the first execution. In that case, login via SSH and do the first clone manually:
Here you can also manually confirm the SSH key fingerprint.
Second hint: You should secure the directory with a .htaccess / .htpasswd file.