I having being trying to find a way to best deploy a WordPress site.
These are my constraints:
- shared hosting
- includes git
- site code hosted on GitHub
- WordPress is added as a submodule
- use the git repo on the server so to be able to use
git statusto check which files have changed when hacked
I tried a few methods with the pro and cons:
- Set up a bare repo on the server and add the server as a remote location that can be pushed to from the local repo.
- Pros: Can easily push from local repo
- Cons : Unable to update the submodule with a hack
- Create a non-bare repo on the server and connect using SSH and run
- Pros: Works without a hack
- Cons: Requires logging in via SSH to update
- Use a service like dploy.io
- Pros: automatically update the repo using shell commands.
- Cons: It costs extra per repo
- I have looked for some code that would use the GitHub hooks but not found anything yet that would work on a shared host.
How do you deploy your sites?