Skip to content

Instantly share code, notes, and snippets.

@geotrev
Created January 3, 2020 02:46
Show Gist options
  • Save geotrev/c1c658cc8e3c4d97bdcf470a8a0b51df to your computer and use it in GitHub Desktop.
Save geotrev/c1c658cc8e3c4d97bdcf470a8a0b51df to your computer and use it in GitHub Desktop.
Circle CI Config for GH Pages
version: 2
jobs:
build:
working_directory: ~/repo-working-dir
docker:
- image: circleci/ruby:2.6.5-node-browsers
steps:
- checkout
- save_cache:
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo-working-dir
- run: npm install
- save_cache:
key: v1-node-deps-{{ checksum "package.json" }}
paths:
- node_modules
test:
working_directory: ~/repo-working-dir
docker:
- image: circleci/ruby:2.6.5-node-browsers
steps:
- restore_cache:
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- v1-node-deps-{{ checksum "package.json" }}
- v1-node-deps-
- run: npm test
deploy:
working_directory: ~/repo-working-dir
docker:
- image: circleci/ruby:2.6.5-node-browsers
steps:
- restore_cache:
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- v1-node-deps-{{ checksum "package.json" }}
- v1-node-deps-
- add_ssh_keys:
fingerprints:
- "68:cc:f2:54:3a:ae:43:29:e7:03:3a:ce:f9:df:9c:6f"
- run: gem install bundler:2.1.2
- run: bundle install
- run: npm run build
- deploy:
name: Deploy to Github Pages
command: bash .bin/deploy.sh
workflows:
version: 2
build-deploy:
jobs:
- build
- test:
requires:
- build
- deploy:
requires:
- test
filters:
branches:
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment