Update: Simplest way to host your Ghost blog on GitHub Pages

Update: Simplest way to host your Ghost blog on GitHub Pages

Last year I created a post about how to get a Ghost blog up and running on Github Pages without much effort.

This worked well, but after being forced to update ghost-cli to version 1.17.3 I ran into a few issues and had to rethink the entire process.

Luckily, I found an even simpler way to do it.

Assuming you have a local instance of Ghost running on the default port 2368:

  • Make sure you have wget installed
  • Add this script to your directory but make sure to replace yourdomain.com with your actual Github Pages domain, e.g.: inesmartins.github.io:

(based on script from fizzy.cc)

This script generate a static directory with the entire content of your Ghost instance as a static website. Just copy this content to the Github Pages repository, and your website will be instantly updated.

In order to make this process even easier, I created an NPM script, which makes this as easy as running: npm run publish on your original repository: