{"id":13554835,"url":"https://github.com/developmentseed/jekyll-hook","last_synced_at":"2025-06-23T21:40:59.404Z","repository":{"id":7556068,"uuid":"8909369","full_name":"developmentseed/jekyll-hook","owner":"developmentseed","description":"No Longer Maintained | A server that listens for GitHub webhook posts and renders a Jekyll site","archived":false,"fork":false,"pushed_at":"2016-09-07T22:01:49.000Z","size":66,"stargazers_count":506,"open_issues_count":10,"forks_count":77,"subscribers_count":82,"default_branch":"master","last_synced_at":"2025-04-03T07:39:31.878Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developmentseed.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-20T16:49:57.000Z","updated_at":"2025-01-06T17:01:49.000Z","dependencies_parsed_at":"2022-09-21T23:13:56.079Z","dependency_job_id":null,"html_url":"https://github.com/developmentseed/jekyll-hook","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/developmentseed/jekyll-hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fjekyll-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fjekyll-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fjekyll-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fjekyll-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developmentseed","download_url":"https://codeload.github.com/developmentseed/jekyll-hook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fjekyll-hook/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261561183,"owners_count":23177545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T12:02:55.862Z","updated_at":"2025-06-23T21:40:59.365Z","avatar_url":"https://github.com/developmentseed.png","language":"JavaScript","readme":"# jekyll-hook\n\n**Note:** This tool is **no longer maintained**. There are a number of newer and better approaches to update jekyll-powered websites. We use Continious Integration (e.g. Travis) as a replacement for jekyll-hook at Development Seed. Read more here: https://jekyllrb.com/docs/deployment-methods/\n\nA server that listens for webhook posts from GitHub, generates a website with\nJekyll, and moves it somewhere to be published. Use this to run your own GitHub\nPages-style web server. Great for when you need to serve your websites behind a\nfirewall, need extra server-level features like HTTP basic auth (see below for an\nNGINX config with basic auth), or want to host your site directly on a CDN or\nfile host like S3. It's cutomizable with two user-configurable shell scripts\nand a config file.\n\n*This guide is tested on Ubuntu 14.0*\n\n## Dependencies Installation\n\nFirst install main dependencies\n\n    $: sudo apt-get update\n    $: sudo apt-get install git nodejs ruby ruby1.9.1-dev npm\n\nSymlink nodejs to node\n\n    $: sudo ln -s /usr/bin/nodejs /usr/bin/node\n\nTo keep server running we use Forever:\n\n    $: sudo npm install -g forever\n\nWe also need Jekyll and Nginx\n\n    $: sudo gem install jekyll rdiscount json\n    $: sudo apt-get install nginx\n\n## Installation\n\nClone the repo\n\n    $: git clone https://github.com/developmentseed/jekyll-hook.git\n\nInstall dependencies:\n\n    $: cd jekyll-hook\n    jekyll-hook $: npm install\n\nIf you receive an error similar to this `npm ERR! Error: EACCES, mkdir\n'/home/ubuntu/tmp/npm-2223-4myn3niN'` run:\n\n    $: sudo chown -R ubuntu:ubuntu /home/ubuntu/tmp\n    $: npm install\n\n*You should replace `ubuntu` with your username*\n\n## Configuration\n\nCopy `config.sample.json` to `config.json` in the root directory and customize:\n\n    $: cp config.sample.json config.json\n    $: vim config.json\n\nConfiguration attributes:\n\n- `gh_server` The GitHub server from which to pull code, e.g. github.com\n- `temp` A directory to store code and site files\n- `public-repo` Whether the repo is public or private (default is public)\n- `scripts`\n    - `[branch-name]` (optional)\n        - `build` The build script to run for a specific branch.\n        - `publish` The publish script to run for a specific branch.\n    - `#default`\n        - `build` The build script to run if no match was found for the branch specified in the webhook.\n        - `publish` The publish script to run if match was found for the branch specified in the webhook.\n- `secret` Optional. GitHub webhook secret.\n- `email` Optional. Settings for sending email alerts\n    - `isActivated` If set to true email will be sent after each trigger\n    - `user` Sending email account's user name (e.g. `example@gmail.com`)\n    - `password` Sending email account's password\n    - `host` SMTP host for sending email account (e.g. `smtp.gmail.com`)\n    - `ssl` `true` or `false` for SSL\n- `accounts` An array of accounts or organizations whose repositories can be used\nwith this server\n\nYou can also adjust `build.sh` and `publish.sh` to suit your workflow. By default,\nthey generate a site with Jekyll and publish it to an NGINX web directory.\n\n## Webhook Setup on Github\n\nSet a [Web hook](https://developer.github.com/webhooks/) on your GitHub repository\nthat 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.\n\nFor every branch you want to build/publish (as defined in the `scripts`) you need to set up a different webhook.\n\n## Configure a webserver (nginx)\n\nThe default `publish.sh` is setup for nginx and copies `_site` folder to `/usr/share/nginx/html/rep_name`.\n\nIf you would like to copy the website to another location, make sure to update\nnginx virtual hosts which is located at `/etc/nginx/nginx/site-available` on Ubuntu 14.\n\nYou also need to update `publish.sh`\n\nFor more information Google or [read this](https://www.digitalocean.com/community/tutorials/how-to-configure-the-nginx-web-server-on-a-virtual-private-server):\n\n## Launch\n\n    $: ./jekyll-hook.js\n\nTo launch in background run:\n\n    $: forever start jekyll-hook.js\n\nTo kill or restart the background job:\n\n```\n    $: forever list\n    info:    Forever processes running\n    data:        uid  command         script         forever pid  logfile                        uptime\n    data:    [0] ZQMF /usr/bin/nodejs jekyll-hook.js 4166    4168 /home/ubuntu/.forever/ZQMF.log 0:0:1:22.176\n    $: forever stop 0\n```\n\n## Publishing content\n\n### S3\n\nTo publish the site on Amazon S3, you need to install S3cmd. On Ubuntu run:\n\n    $: sudo apt-get install s3cmd\n    $: s3cmd --configure\n\nFor more information [read this](http://xmodulo.com/2013/06/how-to-access-amazon-s3-cloud-storage-from-command-line-in-linux.html).\n\n`scripts/publish-s3.sh` does the rest of the job for you. Just make sure to add your bucket name there.\n\n### More details on build.sh\n\nThe 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:\n\n```\nserver {\n    root /usr/share/nginx/www;\n    index index.html index.htm;\n\n    # Make site accessible from http://localhost/\n    server_name localhost;\n\n    location / {\n        # First attempt to serve request as file, then\n        # as directory, then fall back to index.html\n        try_files $uri $uri/ /index.html;\n\n        # Optional basic auth restriction\n        # auth_basic \"Restricted\";\n        # auth_basic_user_file /etc/nginx/.htpasswd;\n    }\n}\n```\n\nReplace this script with whatever you need for your particular hosting environment.\n\nYou probably want to configure your server to only respond POST requests from GitHub's\npublic IP addresses, found on the webhooks settings page.\n","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fjekyll-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopmentseed%2Fjekyll-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fjekyll-hook/lists"}