This post will give a short instruction to serve your own static website (i.e. a website only contains static assets).
Before deploying your local revision of the website, you need to add a
post-receive hook in the server side to let the website well-served by the server web engine. For example, assume you use
nginx to serve the remote website, and it’s served in the server side folder
/var/www/my_blog, what you need to do is, checkout the website files into the folder without the git repository information (i.e.
.git folder). This can be done by the script:
Finally, we can change your local revision of the website, then
git commit && git push the changes. After the change pushed successfully, the updated version will be copied to the right folder in the server side (e.g. the
/var/www/my_blog/ mentioned below).