Jekyll

apt-get update
apt-get -y install build-essential ruby ruby-dev
gem install bundler jekyll
jekyll new project-name

Github

Webhook

Webhook Settings

https://github.com/user/project/settings/hooks
Payload URL: https://example.com/webook/
Content Type: application/x-www-form-urlencoded
Secret: See section below
SSL Verification: Enable
Events to trigger the webhook: Send me everything
Active: True

Webhook Password

ruby -rsecurerandom -e 'puts SecureRandom.hex(20)'

Reference

https://developer.github.com/webhooks/securing/

Deploy Keys

ssh-keygen

Webhook Server

Clone Repository

ssh-add ~/.ssh/id_rsa
git clone [email protected]:user/repo.git

Build Jekyll Project

Build using command in Linux

bundle install
jekyll build

Build using Docker

FROM jekyll/builder:3.8
COPY Gemfile /srv/jekyll/Gemfile
RUN jekyll -v
docker build . -t jekyll-builder
docker run \
  -v $(pwd):/srv/jekyll \
  jekyll-builder \
  jekyll build
docker pull jekyll/builder:3.8
docker run --rm \
  -v "$PWD:/srv/jekyll:rw" \
  -it jekyll/builder:3.8 \
  jekyll build

Issues

https://stackoverflow.com/questions/6317980/you-have-already-activated-x-but-your-gemfile-requires-y

Docker

https://docs.docker.com/install/linux/docker-ce/ubuntu/

Nginx

docker pull nginx:1.17.3

Nginx Configuration

docker run \
    --restart=always \
    -v /root/SLI-Official-Website/_site:/usr/share/nginx/html:ro" \
    -v /root/nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro \
    -v /root/nginx/ssl/server.crt:/etc/nginx/ssl/server.crt \
    -v /root/nginx/ssl/server.key:/etc/nginx/ssl/server.key \
    -p 80:80 \
    -p 443:443 \
    nginx:1.17.3