From 9f8cbec6b495e8f39b9d2069dabc43f35b90d7c8 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Fri, 16 Nov 2018 14:16:23 -0500 Subject: [PATCH] add circleci website build move circleci config to root --- .circleci/config.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..eed549727 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,42 @@ +version: 2 +jobs: + build-website: + # setting the working_directory along with the checkout path allows us to not have + # to cd into the website/ directory for commands + working_directory: ~/project/website + docker: + - image: hashicorp/middleman-hashicorp:0.3.35 + steps: + - checkout: + path: ~/project + + # restores gem cache + - restore_cache: + key: static-site-gems-v1-{{ checksum "Gemfile.lock" }} + + - run: + command: bundle check || bundle install --path vendor/bundle + + # saves gem cache if we have changed the Gemfile + - save_cache: + key: static-site-gems-v1-{{ checksum "Gemfile.lock" }} + paths: + - ~/project/website/vendor/bundle + + # middleman build + - run: + command: bundle exec middleman build + + # website deploy + - run: + command: ./scripts/deploy.sh + +workflows: + version: 2 + website: + jobs: + - build-website: + context: static-sites + filters: + branches: + only: stable-website