From 2299ebb52840138924ca7c44a61be32549cd64d7 Mon Sep 17 00:00:00 2001 From: khelia <58723166+khelia148@users.noreply.github.com> Date: Sun, 28 Mar 2021 17:59:04 +0200 Subject: [PATCH] update config.yml --- .circleci/config.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 095ad34..9bf7114 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,6 +20,16 @@ workflows: branches: only: - main + - netlify_build: + requires: + - build + - netlify_deploy: + requires: + - netlify_build + filters: + branches: + only: + - main - build_docs_artifact: requires: - test @@ -80,6 +90,40 @@ jobs: docker tag $IMAGE_NAME:app $IMAGE_NAME:latest docker push $IMAGE_NAME:$CIRCLE_BUILD_NUM docker push $IMAGE_NAME:latest + netlify_build: + docker: + - image: circleci/buildpack-deps:stretch + working_directory: ~/repo + steps: + - checkout + - restore_cache: + keys: + - dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }} + - run: npm install + - run: npm 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 + netlify_deploy: + docker: + - image: circleci/buildpack-deps:stretch + working_directory: ~/my-awesome-project + steps: + - attach_workspace: + at: /tmp + - run: + name: Deploy app + command: | + ls -al /tmp + sudo npm install -g --silent netlify-cli + netlify deploy --prod --auth $NETLIFY_AUTH_TOKEN --dir=/tmp/dist --site $SITEID build_docs_artifact: docker: - image: cimg/node:12.18.4