|
|
@ -14,17 +14,41 @@ jobs: |
|
|
paths: |
|
|
paths: |
|
|
- node_modules |
|
|
- node_modules |
|
|
key: dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }} |
|
|
key: dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }} |
|
|
|
|
|
|
|
|
server-doc-deploy: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
server-build: |
|
|
|
|
|
docker: |
|
|
|
|
|
- image: circleci/node:12 |
|
|
|
|
|
steps: |
|
|
|
|
|
- checkout |
|
|
|
|
|
- restore_cache: |
|
|
|
|
|
keys: |
|
|
|
|
|
- yarn-packages-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }} |
|
|
|
|
|
- run: |
|
|
|
|
|
name: Build for production |
|
|
|
|
|
command : yarn run build |
|
|
|
|
|
- run: |
|
|
|
|
|
name: Copy build to workspace |
|
|
|
|
|
command: | |
|
|
|
|
|
cp dist/ /tmp/dist -r |
|
|
|
|
|
- store_artifacts: |
|
|
|
|
|
path: /tmp/dist |
|
|
|
|
|
- persist_to_workspace: |
|
|
|
|
|
root: /tmp |
|
|
|
|
|
paths: |
|
|
|
|
|
- dist |
|
|
|
|
|
server-deploy: |
|
|
docker: |
|
|
docker: |
|
|
- image: circleci/node:dubnium-browsers |
|
|
- image: circleci/node:dubnium-browsers |
|
|
|
|
|
working_directory: ~/netlify-deploy |
|
|
steps: |
|
|
steps: |
|
|
|
|
|
- attach_workspace: |
|
|
|
|
|
at: /tmp |
|
|
- run: |
|
|
- run: |
|
|
name: install netlify |
|
|
name: install netlify |
|
|
command: sudo npm install netlify-cli -g |
|
|
command: sudo npm install netlify-cli -g |
|
|
- run: |
|
|
- run: |
|
|
name: Deploy app |
|
|
name: Deploy app |
|
|
command: netlify deploy --prod --auth $NETLIFY_AUTH_TOKEN --dir /repo --site $NETLIFY_SITE_ID |
|
|
|
|
|
|
|
|
command: netlify deploy --prod --auth $NETLIFY_AUTH_TOKEN --dir=/tmp/dist --site $NETLIFY_SITE_ID |
|
|
|
|
|
|
|
|
docker-build-and-push: |
|
|
docker-build-and-push: |
|
|
docker: |
|
|
docker: |
|
|
@ -50,11 +74,20 @@ workflows: |
|
|
build-deploy: |
|
|
build-deploy: |
|
|
jobs: |
|
|
jobs: |
|
|
- build |
|
|
- build |
|
|
- server-doc-deploy: |
|
|
|
|
|
|
|
|
- server-deploy: |
|
|
|
|
|
requires: |
|
|
|
|
|
- build |
|
|
|
|
|
- server-deploy: |
|
|
requires: |
|
|
requires: |
|
|
- build |
|
|
|
|
|
|
|
|
- server-build |
|
|
|
|
|
filters: |
|
|
|
|
|
branches: |
|
|
|
|
|
only: main |
|
|
- docker-build-and-push: |
|
|
- docker-build-and-push: |
|
|
requires: |
|
|
requires: |
|
|
- build |
|
|
- build |
|
|
|
|
|
filters: |
|
|
|
|
|
branches: |
|
|
|
|
|
only: main |
|
|
|
|
|
|
|
|
|
|
|
|