how to deploy from GH pages to Digital Ocean?

  • Posted August 21, 2014

as a beginner, I would like to learn how to deploy and set up/config my current GH project to automatically deploy to my DO account? Other any rules of thumb or talks that I could consult for proper methodology?


It’s not clear whether you’re asking to deploy Github pages as a website or Github code projects as a web application.

(Assuming you mean Github at all, because I’ve never seen it written GH)

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

To deploy your site when you push to GitHub, you’d generally need to use a GitHub webhook to make a POST to the url you provide when GitHub recieves a push. Then on your server, you’d have a script listening for that POST. When it receives it, the script would do a git pull and restart the application.

There are a number of approaches that you can take to deal with the server side. This blog post has one implementation using gith, a simple node server that responds to github post-receive events.

A more straightforward approach might just be to create a new git remote pointing to your server. That way you can push changes to GitHub that aren’t necessarily ready for production and then push to the new remote when you want to deploy. You can use a post receive hook to do any other server side steps. Check out:

I mean to push a GH node.js project from the GHsite to DO.

For instance, this prototype: