From a3d67177865b028829065f3a4109221a81ae3e5d Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sat, 10 Feb 2018 20:49:11 -0500 Subject: [PATCH] Adding start of preview/prod deployments in CircleCI config --- .circleci/config.yml | 60 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 473aa74..d1384c8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,6 @@ version: 2 jobs: - build: - branches: - only: - - react + build_preview: docker: - image: circleci/node:7.10 @@ -27,3 +24,58 @@ jobs: key: v1-dependencies-{{ checksum "package.json" }} - run: yarn test + + - run: + command: yarn build + environment: + GA_PROPERTY: "UA-37364632-2" + SENTRY_KEY: "https://37efcfdc7c6d4f0d942497c4dd609254@sentry.io/197339" + + # TODO: Deploy to preview.regexper.com + build_prod: + docker: + - image: circleci/node:7.10 + + working_directory: ~/repo + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: yarn install + + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + + - run: yarn test + + - run: + command: yarn build + environment: + GA_PROPERTY: "UA-37364632-1" + SENTRY_KEY: "https://37efcfdc7c6d4f0d942497c4dd609254@sentry.io/197339" + + # TODO: Deploy to regexper.com + +workflows: + version: 2 + build_deploy_preview: + jobs: + - build_preview: + filters: + tags: + ignore: /.*/ + build_deploy_prod: + jobs: + - build_prod: + filters: + tags: + only: /.*/