Build your Jekyll sites on your own server, with an optional web log interface.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
script
vendor
.dockerignore
.gitignore
.travis.yml
Dockerfile
Gopkg.lock
Gopkg.toml
LICENSE
Makefile
README.md
builder.go
database.go
html.go
html_test.go
jekyll-build-server.go
shell.go
shell_test.go

README.md

jekyll build server

Taking a webhook approach to building sites in Jekyll. Kind of like jekyll-hook and others, but with a single binary because Go is nice.

Build Status

Installation & Usage

$ go get byparker.com/go/jekyll-build-server
$ $GOPATH/bin/jekyll-build-server -owner="your-username-or-org"

Daemonize it or put it in a screen session if you want.

Add a webhook to this server's POST /_github endpoint. Each request will be checked and only build if on the master branch and if the repo has the proper owner. It will clone the repo into ${src}/${repo_nwo} and build it into ${dest}/${repo_nwo}

Dependencies

You'll need:

  • Go
  • Ruby
  • Bundler
  • Git
  • A public-facing IP or domain name

Configuration

All the configuration happens in flags:

  • -owner="your-username-or-org" – the string your repos' full names (e.g. "parkr" in "parkr/jekyll-build-server") must start with in order to be authorized to be built
  • -bind=":9090" – the port/host to bind the server to
  • -src="/tmp" – the directory to clone the sources into
  • -dest="/var/www" – the base directory to put built sites into
  • -db="localhost@/builds" – the connection string where your builds are stored. optional

Run jekyll-build-server -h to learn more at any time.

Server Configuration

I serve my static files with nginx. A very simple HTTP server might look like this:

server {
  listen 80;
  server_name example.com;
  root /var/www/parkr/example.com;
  error_page 404 = /404.html;

  location / {
    try_files $uri $uri.html $uri/index.html index.html;
  }
}

This would serve the static files built for the parkr/example.com repo at example.com:80.

... that's really it!