Skip to content

Instantly share code, notes, and snippets.

@urre
Created December 7, 2018 13:37
Show Gist options
  • Save urre/4d443aec0e6173034dbf73c05fb959cd to your computer and use it in GitHub Desktop.
Save urre/4d443aec0e6173034dbf73c05fb959cd to your computer and use it in GitHub Desktop.
Circle CI config for Jekyll
version: 2
jobs:
build:
docker:
- image: circleci/ruby:2.5.0-node
working_directory: ~/repo
steps:
- checkout
- add_ssh_keys:
fingerprints:
- "XXXXXXXXXXXXXX"
- run:
name: Add Cloudways to known_hosts
command: ssh-keyscan -H XXX.XXX.XXX >> ~/.ssh/known_hosts
- run:
name: Ruby dependencies
command: bundle install
- run:
name: Node dependencies
command: npm install
- run:
name: Install rsync
command: sudo apt install rsync
- save_cache:
paths:
- /usr/local/bundle
- /usr/local/lib/node_modules
key: v2-dependencies-{{ checksum "Gemfile.lock" }}
- run:
name: Build Jekyll site
command: bundle exec jekyll build --config _config.yml --verbose
- run:
name: Build Sass and JavaScript
command: npm run buildassets
- run:
name: Deploy to Cloudways with rsync over ssh
command: rsync -avzO --no-perms -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress --exclude=.git/ --exclude=.asset-cache/ --exclude=node_modules/ ${CI_COPYDIR} ${CI_USER}@${CI_HOST}:${CI_PATH}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment