From 6982c7b3f80f2f97d1fdc91074bd628d02ac7b3c Mon Sep 17 00:00:00 2001 From: ztimson Date: Thu, 11 Apr 2019 16:58:32 -0400 Subject: [PATCH] Added build config --- .circleci/config.yml | 86 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..c470903 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,86 @@ +version: 2 + +jobs: + build: + docker: + - image: circleci/node:10.4-browsers + + working_directory: ~/repo + + steps: + - checkout + + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package.json" }} + - v1-dependencies- + + - run: + name: Install Dependancies + command: yarn + + - save_cache: + key: v1-dependencies-{{ checksum "package.json" }} + path: node_modules + + - run: + name: Build + command: yarn build + + - persist_to_workspace: + root: ./ + path: ./dist/ZaksCode + + - store_artifacts: + path: ./dist/ZaksCode + + deploy: + docker: + - image: google/cloud-sdk:latest + + working_directory: ~/repo + + steps: + - checkout + + - attach_workspace: + at: ./ + + - run: + name: Deploy + command: gsutil cp -r dist/ZaksCode/* gs://staging.zaks-code.appspot.com + + deploy-prod: + docker: + - image: google/cloud-sdk:latest + + working_directory: ~/repo + + steps: + - checkout + + - attach_workspace: + at: ./ + + - run: + name: Depoly + command: gsutil cp -r dist/ZaksCode/* gs://zaks-code.appspot.com + +workflows: + version: 2 + + build_and_deply: + jobs: + - build + - deploy: + requires: + - build + filters: + branches: + only: master + - deploy-prod: + requires: + - build + filters: + branches: + only: production