Browse Source

💚 refactor config

main
verzelea 6 years ago
parent
commit
9ff7acaddb
  1. 35
      .circleci/config.yml

35
.circleci/config.yml

@ -2,7 +2,7 @@ version: 2.1
jobs:
build:
docker:
- image: cimg/node:15.5.1-browsers
- image: circleci/node:dubnium-browsers
steps:
- checkout
- restore_cache:
@ -16,50 +16,48 @@ jobs:
- node_modules
test:
docker:
- image: cimg/node:15.5.1-browsers
- image: circleci/node:dubnium-browsers
steps:
- checkout
- restore_cache:
keys:
key: yarn-packages-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
- yarn-packages-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
- run:
- name: Start test
- command : yarn test
name: Start test
command: yarn test
build-in-prod:
docker:
- image: cimg/node:15.5.1-browsers
- image: circleci/node:dubnium-browsers
steps:
- checkout
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
- run:
- name: Build the project
- command : yarn run build
name: Build
command : yarn run build
- run:
- name: Copy build
- command: |
ls
cp build/ /tmp/build -r
name: Copy build
command: |
cp dist/ /tmp/dist -r
- store_artifacts:
path: /tmp/build
path: /tmp/dist
- persist_to_workspace:
root: /tmp
paths:
- build
- dist
deploy:
docker:
- image: cimg/node:15.5.1-browsers
- image: circleci/node:dubnium-browsers
working_directory: ~/deploy-netlfify
steps:
- attach_workspace:
at: /tmp
- run:
name: Deploy app
name: Deploy on netlify
command: |
sudo npm install -g --silent netlify-cli
ls /tmp
netlify deploy --prod --auth $NETLIFY_TOKEN --dir=/tmp/build --site $NETLIFY_SITE_ID
netlify deploy --prod --auth $NETLIFY_TOKEN --dir=/tmp/dist --site $NETLIFY_SITE_ID
workflows:
build_deploy:
jobs:
@ -70,5 +68,4 @@ workflows:
- deploy:
context: netlify
requires:
- build
- build-in-prod
Loading…
Cancel
Save