You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A server that listens for webhook posts from GitHub, generates a website with Jekyll, and moves it somewhere to be published. Use this to run your own GitHub Pages-style web server. Great for when you need to serve your websites behind a firewall, need extra server-level features like HTTP basic auth (see below for an NGINX config with basic auth), or want to host your site directly on a CDN or file host like S3. It's cutomizable with two user-configurable shell scripts and a config file.
3
+
A server that listens for webhook posts from GitHub, generates a website with
4
+
Jekyll, and moves it somewhere to be published. Use this to run your own GitHub
5
+
Pages-style web server. Great for when you need to serve your websites behind a
6
+
firewall, need extra server-level features like HTTP basic auth (see below for an
7
+
NGINX config with basic auth), or want to host your site directly on a CDN or
8
+
file host like S3. It's cutomizable with two user-configurable shell scripts
- Set a [Web hook]() on your GitHub repository that points to your jekyll-hook server `http://example.com:8080/hooks/jekyll/:branch`, where `:branch` is the branch you want to publish. Usually this is `gh-pages` or `master` for `*.github.com` / `*.github.io` repositories.
If you receive an error similar to this `npm ERR! Error: EACCES, mkdir
45
+
'/home/ubuntu/tmp/npm-2223-4myn3niN'` run:
46
+
47
+
$: sudo chown -R ubuntu:ubuntu /home/ubuntu/tmp
48
+
$: npm install
49
+
50
+
*You should replace `ubuntu` with your username*
10
51
11
52
## Configuration
12
53
13
-
Adjust `build.sh` and `publish.sh` to suit your workflow. By default, they generate a site with Jekyll and publish it to an NGINX web directory.
54
+
Copy `config.sample.json` to `config.json` in the root directory and customize:
14
55
15
-
Copy `config.sample.json` to `config.json` in the root directory and customize.
56
+
$: cp config.sample.json config.json
57
+
$: vim config.json
16
58
17
59
Configuration attributes:
18
60
19
-
-`gh_server` The GitHub server from which to pull code
61
+
-`gh_server` The GitHub server from which to pull code, e.g. github.com
20
62
-`temp` A directory to store code and site files
63
+
-`public-repo` Whether the repo is public or private (default is public)
21
64
-`scripts`
22
65
-`build` A script to run to build the site
23
66
-`publish` A script to run to publish the site
24
67
-`email` Optional. Settings for sending email alerts
68
+
-`isActivated` If set to true email will be sent after each trigger
25
69
-`user` Sending email account's user name (e.g. `[email protected]`)
26
70
-`password` Sending email account's password
27
-
-`host` SMTP host for sending email account (e.g. `smtp.gmail.com`)
71
+
-`host` SMTP host for sending email account (e.g. `smtp.gmail.com`)
28
72
-`ssl``true` or `false` for SSL
29
-
-`accounts` An array of accounts or organizations whose repositories can be used with this server
30
-
## Usage
73
+
-`accounts` An array of accounts or organizations whose repositories can be used
74
+
with this server
75
+
76
+
You can also adjust `build.sh` and `publish.sh` to suit your workflow. By default,
77
+
they generate a site with Jekyll and publish it to an NGINX web directory.
78
+
79
+
## Webhook Setup on Github
80
+
81
+
Set a [Web hook](https://developer.github.com/webhooks/) on your GitHub repository
82
+
that points to your jekyll-hook server `http://example.com:8080/hooks/jekyll/:branch`, where `:branch` is the branch you want to publish. Usually this is `gh-pages` or `master` for `*.github.com` / `*.github.io` repositories.
83
+
84
+
## Configure a webserver (nginx)
85
+
86
+
The default `publish.sh` is setup for nginx and copies `_site` folder to `/usr/share/nginx/html/rep_name`.
87
+
88
+
If you would like to copy the website to another location, make sure to update
89
+
nginx virtual hosts which is located at `/etc/nginx/nginx/site-available` on Ubuntu 14.
90
+
91
+
You also need to update `publish.sh`
92
+
93
+
For more information Google or [read this](https://www.digitalocean.com/community/tutorials/how-to-configure-the-nginx-web-server-on-a-virtual-private-server):
To publish the site on Amazon S3, you need to install S3cmd. On Ubuntu run:
118
+
119
+
$: sudo apt-get install s3cmd
120
+
$: s3cmd --configure
121
+
122
+
For more information [read this](http://xmodulo.com/2013/06/how-to-access-amazon-s3-cloud-storage-from-command-line-in-linux.html).
123
+
124
+
`scripts/publish-s3.sh` does the rest of the job for you. Just make sure to add your bucket name there.
125
+
126
+
### More details on build.sh
127
+
36
128
The stock `build.sh` copies rendered site files to subdirectories under a web server's `www` root directory. For instance, use this script and NGINX with the following configuration file to serve static content behind HTTP basic authentication:
37
129
38
130
```
@@ -57,39 +149,5 @@ server {
57
149
58
150
Replace this script with whatever you need for your particular hosting environment.
59
151
60
-
You probably want to configure your server to only respond POST requests from GitHub's public IP addresses, found on the webhooks settings page.
61
-
62
-
## Dependencies
63
-
64
-
Here's a sample script to install the approriate dependencies on an Ubuntu server:
65
-
66
-
```sh
67
-
#!/bin/sh
68
-
69
-
# Install node and depencencies
70
-
sudo apt-get update -y
71
-
sudo apt-get install python-software-properties python g++ make -y
72
-
# On Ubuntu 12.10 and greater, add-apt-repository is provided by the software-properties-common package
0 commit comments