Total Pageviews

Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts

Monday, 27 April 2026

Deploy Jekyll sites anywhere using jekyll-hook

 

This tutorial covers using jekyll-hook to automatically deploy changes from your GitHub repo to your own server.

What is jekyll-hook? Direct link to this section

jekyll-hook is a Node.js program which runs on a server. It listens for new commits on a GitHub repository using webhooks. When there is a commit, jekyll-hook pulls the latest source code, builds the site with Jekyll, then deploys the built site to a directory.

Setup Direct link to this section

I'm using Ubuntu 14.04 so adjust the instructions for your operating system.

Install Git, Node.js, Ruby and Jekyll:


$ sudo apt-get update

$ sudo apt-get install git nodejs ruby ruby1.9.1-dev npm

$ sudo gem install jekyll -v 2.4.0

Symlink nodejs to node:


$ sudo ln -s /usr/bin/nodejs /usr/bin/node

Clone the jekyll-hook repo from GitHub:


$ git clone https://github.com/developmentseed/jekyll-hook.git

Install the dependencies:


$ cd jekyll-hook

$ npm install

Configuration Direct link to this section

Copy the sample configuration to config.json:


$ cp config.sample.json config.json

Open config.json in a text editor.

With this script you can configure jekyll-hook to listen to a particular server, run special build scripts for a particular Git branch or send an email every time there's a build. The default config.json get us most of the way there, we just need to ensure changes can be pulled in from our account.

Change accounts to your GitHub account or organisation.


$ nano config.json

Here's my complete config.json:


{

"gh_server": "github.com",

"temp": "/home/ubuntu/jekyll-hook",

"public_repo": true,

"scripts": {

"#default": {

"build": "./scripts/build.sh",

"publish": "./scripts/publish.sh"

}

},

"secret": "",

"email": {

"isActivated": false,

"user": "",

"password": "",

"host": "",

"ssl": true

},

"accounts": [

"cloudcannon",

"mneumegen"

]

}

As you can see from the configuration, jekyll-hook is going to run ./scripts/build.sh when it detects a change. The default build script pulls the latest commits to the local repository and runs jekyll build. We don't need to change anything in this file.

Here's my ./scripts/build.sh:


#!/bin/bash

set -e

# This script is meant to be run automatically

# as part of the jekyll-hook application.

# https://github.com/developmentseed/jekyll-hook

repo=$1

branch=$2

owner=$3

giturl=$4

source=$5

build=$6

# Check to see if repo exists. If not, git clone it

if [ ! -d $source ]; then

git clone $giturl $source

fi

# Git checkout appropriate branch, pull latest code

cd $source

git checkout $branch

git pull origin $branch

cd -

# Run jekyll

cd $source

jekyll build -s $source -d $build

cd -

After the build finishes, jekyll-hook, runs ./scripts/publish.sh. This script moves the built site to your web server directory.

By default jekyll-hook deploys the site to /usr/share/nginx/html/$repo. $repo is one of the variables jekyll-hook makes available to use in the path. You can also use $branch, $owner, $giturl, $source and $build.

Change site to your desired location.


$ nano scripts/publish.sh

Here's my complete scripts/publish.sh:


#!/bin/bash

set -e

# This script is meant to be run automatically

# as part of the jekyll-hook application.

# https://github.com/developmentseed/jekyll-hook

repo=$1

branch=$2

owner=$3

giturl=$4

source=$5

build=$6

# Set the path of the hosted site

site="/home/ubuntu/$repo"

# Remove old site files, move new ones in place

# On amazon EC2 use sudo if nginx html forlder has root ownership

rm -rf $site

Jekyll-hook is set up to listen for changes from GitHub. When there is a change it will build the site and deploy it to a folder.

Webhook Direct link to this section

Now we need GitHub to send jekyll-hook a webhook when there's a commit to the repository.

Open your repository on GitHub. Then go to Settings -> Webhooks & services.

![GitHub webhooks](https://cc-dam.imgix.net/blog/images/blog/jekyll-hook/github.png)\

Click Add webhook. Set the Payload URL to point at your jekyll-hook server http://example.org:8080/hooks/jekyll/:branch where :branch is the branch you want to publish. The rest of the defaults are fine, press Add webhook.

![GitHub webhook](https://cc-dam.imgix.net/blog/images/blog/jekyll-hook/github-webhook.png)\

Deploying the site Direct link to this section

Run jekyll-hook. It listens for changes on port 8080:


$ ./jekyll-hook.js

If you're running this on EC2 remember you'll need to open port 8080 in your security group.

Make a change in the repository and you'll see logs appear in your jekyll-hook program. If nothing happens have a look at your webhook logs on GitHub.

Check the deployment directory to see a built version of your Jekyll site. Now you just need to configure your webserver to serve the site.

from  https://cloudcannon.com/blog/deploy-jekyll-sites-anywhere-using-jekyll-hook/

------

相关帖子:

 https://briteming.blogspot.com/2013/06/linux-vpsruby-jekyll.html

Sunday, 22 February 2026

githuber.cn


感谢您的访问!GitHuber正在进行重大升级维护,预计将持续数周。在此期间登录、搜索等服务暂时关闭,星榜将不定期在此更新。有任何问题请联系邮件


状元 榜眼 探花
C Espressif Systems 云风 July Linwei 黄健宏 Lippi Leo Ma Xinchen Hui 王浩 朱天龙 (Armink)
C# Lion Jeffrey Su Paddy Xu Kerry Jiang Perfare 浅墨(毛星云) Wayne Yiming Zhao Henry topameng
C++ Hao Chen Shuo Chen Shiqi Yu vn.py yangyangwithgnu 吴祖洋 YouTuber@iTeaTime Tech Xiang Gao huihut Jack Yu
CSS 后山人 Coco Yan Zhu Vince Ruan YiFeng 布客飞龙 zhaoolee Bo Wei Xia Mr.Simple
CoffeeScript Zhuang Ma xu han Jason Lee Fred Wu onplus Michael Yin Jinzhu binnng Wei Zhu KasperDeng
Go fatedier astaxie Joe Chen chai2010 Dreamacro xtaci iikira Julien Schmidt smallnest henrylee2cn
HTML Huang Haiguang Phodal Huang 小弟调调™ 王下邀月熊 utom Xuan Huang (黄玄) lifesinger PaddingMe Zhouxuan Yang 小鱼
Java CyC2018 代码家 程序员吴师兄 张鸿洋 布兰柯基 江南一点雨 纯洁的微笑 crossoverJie macro JessYan
JavaScript 小弟调调™ Ruan YiFeng DIYgod EGOIST 贤心 Fengyuan Chen iamkun Jackson Tian cangdu lucifer
Lua AlexaZhou Zhuang Liu Linwei coder 老竭力 云风 Xavier Wang 最萌小汐 新运维社区 午夜
Matlab Shaoqing Ren Googol Lee Alfred Xiang Wu Yu Liu (Louis) Shifeng Zhang Limin Wang Zhenqiang.Ying Ying Tai(邰颖) Yihui He Zehao Huang
Objective-C ibireme M了个J YouTuber@iTeaTime Tech 高少东 Draven Aufree bang yeBlueColor Kevin Wei Wang
PHP walkor Easy 安正超 Song Summer helloqingfeng warlee John Lui dodge 韩天峰-Rango
Perl hexsum Weibin Yao(姚伟斌) Orange Carl Chen 周晶 Hui Chen Fayland Lam Hu Zhifei Simon Joey
Python 骆昊 削微寒 Mort Yao Flood Sung Sun Junyi 神奇的战士 wenxianping Yang Milo Yip Shangtong Zhang
Ruby Richard Huang DeathKing W Shao Livoras Jason Lee Lin Xiangyu Rei Xinyu Fred Wu Eric Guo
Scala Liwei Lin smallnest Wang Zhe 涂名雷 Bo Xu oldpig Liang Depeng Sidney Xu Yang, Bo Cheng Lian
Shell 花果山大圣 hackerxu Teddysun Jimmy Song EtherDream 233boy Judas.n Linwei ZhangJun snowdream
Swift Wei Wang iPader Lex Tang Allen Wang Caldis_Chen zhuhaow Wenchao Ding John Lui Vincent Li 100mango
VimL yangyangwithgnu Maple zc he Barret李靖 Barry Arthur Rykk Juvenn Woo luofei Wang Shidong brookhong
  • 排名以GitHub官方数据作为唯一权威来源
  • 排名以开发者在某编程语言上的所有项目(repo)所收获的星星(star)总数为序
  • 项目的编程语言以GitHub认定的主要编程语言为准,这适用于使用了多种编程语言的项目
更新于2024-12-23 14:16:05 +0800 
 
from  https://githuber.cn

GitHub-Chinese-Top-Charts

 GitHub中文排行榜,各语言分设「软件 | 资料」榜单,精准定位中文好项目。各取所需,高效学习.

GitHub中文排行榜

「帮助你发现优秀中文项目,可以无语言障碍地、更高效地吸收优秀经验成果」


中文项目已通关?通往更广阔世界的路:GitHub英文排行榜

↓ -- 内容目录 -- ↓

中文总榜 中文增速榜 中文新秀榜
软件类 资料类 软件类 资料类 软件类 资料类
All Language All Language All Language All Language All Language All Language
JavaScript JavaScript JavaScript JavaScript JavaScript JavaScript
Java Java Java Java Java Java
Python Python Python Python Python Python
Go Go Go Go Go Go
TypeScript TypeScript TypeScript TypeScript TypeScript TypeScript
Vue Vue Vue Vue Vue Vue
C++ C++ C++ C++ C++ C++
C C C C C C
C# C# C# C# C# C#
PHP PHP PHP PHP PHP PHP
HTML HTML HTML HTML HTML HTML
Swift Swift Swift Swift Swift Swift
Kotlin Kotlin Kotlin Kotlin Kotlin Kotlin
Objective-C Objective-C Objective-C Objective-C Objective-C Objective-C
CSS CSS CSS CSS CSS CSS
Shell Shell Shell Shell Shell Shell
Dart Dart Dart Dart Dart Dart
Rust Rust Rust Rust Rust Rust
Jupyter Notebook Jupyter Notebook Jupyter Notebook Jupyter Notebook Jupyter Notebook Jupyter Notebook
Assembly Assembly Assembly Assembly Assembly Assembly
Vim script Vim script Vim script Vim script Vim script Vim script
Ruby Ruby Ruby Ruby Ruby Ruby
Lua Lua Lua Lua Lua Lua
TeX TeX TeX TeX TeX TeX
Groovy Groovy Groovy Groovy Groovy Groovy
Perl Perl Perl Perl Perl Perl
MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB
Pascal Pascal Pascal Pascal Pascal Pascal
R R R R R

R

 

from https://github.com/GrowingGit/GitHub-Chinese-Top-Charts

Wednesday, 18 February 2026

awesome-projects-boilerplates

 

Boilerplates for mobile and web apps.

Awesome

Curated list of boilerplates and templates to enhance productivity.

Android Development

Boilerplates and templates for Android

IOS Development.

Boilerplates and templates for IOS

JavaScript

Boilerplates and templates for JavaScript

Hybrid Mobile App Frameworks

Microservices

  • Webstack-micro Demo/starter for full-stack web app using microservices architecture, with API Gateway, centralized authentication, background workers, and WebSockets.

Python

Boilerplates and templates for Python

PHP

Boilerplates and templates for PHP

Ruby

Boilerplates and templates for Ruby

.NET

Boilerplates and templates for C#.NET and ASP.NET

  • ASP.NET Boilerplate ASP.NET Boilerplate is a starting point for new modern web applications using best practices and most popular tools.

Go

Boilerplates and templates for Go

Browser Webextensions

Boilerplates and templates to develop webextensions for internet browsers such as Chrome, Firefox and Safari

Websites

Boilerplates and templates for Websites

IDE

Templating Systems for Different IDE's

GitHub

Boilerplates and template files

  • GitHub Template Guidelines Collection of guidelines and boilerplate files for writing maintanable GitHub projects.
  • Pollinate Template your base files and generate them from GitHub.

from https://github.com/melvin0008/awesome-projects-boilerplates