https://github.com/datamade/jekyll-html-hook
:anchor: Webhook listener for deploying Jekyll or static HTML sites
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.3%) to scientific vocabulary
Repository
:anchor: Webhook listener for deploying Jekyll or static HTML sites
Basic Info
Statistics
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 3
- Releases: 0
Metadata Files
readme.md
jekyll-html-hook
A server that listens for webhook posts from GitHub, generates a website with Jekyll, or just copies files in the case of a static HTML site 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 HTTPS for your domain or HTTP basic auth. It's cutomizable with a config file.
The original concept for this is heavily influenced by Development Seed's NodeJS based project, jekyll-hook.
Dependencies Installation
First install main dependencies
sudo apt-get update
sudo apt-get install git python3.4-dev ruby ruby1.9.1-dev redis-server nginx
We also need Jekyll
sudo gem install jekyll rdiscount json
Installation
We recommend using virtualenv and virtualenvwrapper for working in a virtualized development environment. Read how to set up virtualenv. One thing to remember is that this app requires at least Python 3.4.
Once you have virtualenvwrapper set up,
mkvirtualenv jekyll-html-hook
git clone https://github.com/datamade/jekyll-html-hook.git
cd jekyll-html-hook
pip install -r requirements.txt
Afterwards, whenever you want to work on jekyll-html-hook,
workon jekyll-html-hook
Configuration
Copy config.sample.json to config.json in the root directory and customize:
cp app_config.py.example app_config.py
vim app_config.py
Configuration attributes:
GH_SERVERThe GitHub server from which to pull code, e.g. github.comTEMPA directory to store code and site filesSECRETOptional. GitHub webhook secret.SCRIPTSA dictionary where the keys are the names of the kinds of sites you have (by default this app can handle generating a Jekyll site or just handle static HTML) and the values are the relative paths to the scripts that are used to build and/or deploy those sites.ACCOUNTSA list of organizations whose repositories can be used with this server.SENTRY_DSNOptional. DSN to configure Sentry logging.REDIS_QUEUE_KEYA unique string used to identify messages in Redis that the app should pay attention to.
You can also adjust the default scripts in the scripts directory to suit your
workflow. By default, they generate a site with Jekyll or just copy static HTML
files and publish it to an NGINX web directory.
Webhook Setup on Github
Set a Web hook on your GitHub
repository that points to your jekyll-html-hook server
https://example.com/hooks/:site_type/:branch, where :site_type one of the
site types you configured in the SCRIPTS variable above (by default either
jekyll or static) :branch is the branch you want to publish. So,
for example, if you'd like to configure a webhook for a Jekyll site and
only deploy when you push to the deploy branch, your webhook URL would
look like this:
https://example.com/hooks/jekyll/deploy
Configure a webserver (nginx)
The default publish.sh is setup for nginx and copies the generated (or
static) HTML to /usr/share/nginx/html/<repo_name>.
If you would like to copy the website to another location, make sure to update
nginx virtual hosts which is located at /etc/nginx/nginx/site-available on Ubuntu 14.
You also need to update publish.sh
An example Nginx configuration (complete with Gzip and SSL/TLS settings based
upon using Let's Encryt) is in the scripts folder
Run the app
There are two processes, one to handle incoming webhooks and one to actually generate and/or deploy the site.
python app.py
python worker.py
As an an example of how you might daemonize the app and worker, an example
Supervisor configuration file is in the scripts folder.
Other random stuff
You probably want to configure your server to only respond POST requests from GitHub's public IP addresses, found on the webhooks settings page.
Team
- Eric van Zanten - developer
- Derek Eder - developer
Errors / Bugs
If something is not behaving intuitively, it is a bug, and should be reported. Report it here: https://github.com/datamade/jekyll-html-hook/issues
Note on Patches/Pull Requests
- Fork the project.
- Make your feature addition or bug fix.
- Send a pull request. Bonus points for topic branches.
Copyright
Copyright (c) 2016 DataMade. Released under the MIT License.
Owner
- Name: datamade
- Login: datamade
- Kind: organization
- Email: info@datamade.us
- Location: Chicago, IL
- Website: http://datamade.us
- Twitter: datamadeco
- Repositories: 123
- Profile: https://github.com/datamade
We build open source technology using open data to empower journalists, researchers, governments and advocacy organizations.
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 3
- Total pull requests: 4
- Average time to close issues: 38 minutes
- Average time to close pull requests: 5 months
- Total issue authors: 2
- Total pull request authors: 3
- Average comments per issue: 2.67
- Average comments per pull request: 1.25
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- evz (2)
- derekeder (1)
Pull Request Authors
- hazybluedot (2)
- lpmi-13 (1)
- hancush (1)