From 0797eff0b79196665c0ca751ac6548b7d104415a Mon Sep 17 00:00:00 2001 From: Danny Brown Date: Thu, 14 Nov 2019 16:32:14 -0500 Subject: [PATCH] ci: restore release workflow (#1185) * ci: don't build our master branch * Add netlify-cli as a dev dependency * ci: trying a sheltered merge flow for promotions * ci: try building with QUICK_BUILD flag * Try using ~/repo prefix in command * ci: make sure netlify command is available * ci: use sudo for global command * Inline personal access token w/ env var * ci: workaround for sudo limitations * ci: restore release workflow --- .circleci/config.yml | 54 +++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cb30ba99b..57fd17c6d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,8 +32,6 @@ jobs: steps: # Update yarn - run: yarn -v - # Enable yarn workspaces - - run: yarn config set workspaces-experimental true # Checkout code and ALL Git Tags - checkout: post: @@ -193,7 +191,8 @@ jobs: steps: - attach_workspace: at: ~/repo - - run: npx netlify deploy --prod + - run: cd .netlify && npm install + - run: cd .netlify && npm run deploy DEPLOY_TO_PRODUCTION: docker: @@ -205,7 +204,8 @@ jobs: steps: - attach_workspace: at: ~/repo - - run: npx netlify deploy --prod + - run: cd .netlify && npm install + - run: cd .netlify && npm run deploy ### # Workflow: RELEASE @@ -213,8 +213,26 @@ jobs: NPM_PUBLISH: <<: *defaults steps: - - attach_workspace: - at: ~/repo + # Update yarn + - run: yarn -v + # Checkout code and ALL Git Tags + - checkout: + post: + - git fetch --all + - restore_cache: + name: Restore Yarn and Cypress Package Cache + keys: + # when lock file changes, use increasingly general patterns to restore cache + - yarn-packages-{{ checksum "yarn.lock" }} + - yarn-packages- + - run: + name: Install Dependencies + command: yarn install --frozen-lockfile + - save_cache: + name: Save Yarn Package Cache + paths: + - ~/.cache ## Cache yarn and Cypress + key: yarn-packages-{{ checksum "yarn.lock" }} - run: name: Avoid hosts unknown for github command: @@ -428,15 +446,19 @@ workflows: - DEPLOY_TO_PRODUCTION: requires: - PROMOTE_TO_PRODUCTION + # Unit and E2E tests have already run for PR_CHECKS # Re-running should not gain us any confidence here - # RELEASE: - # jobs: - # - NPM_PUBLISH: - # filters: - # branches: - # only: master - # - DOCS_PUBLISH - # - DOCKER_MASTER_PUBLISH: - # requires: - # - NPM_PUBLISH + RELEASE: + jobs: + - NPM_PUBLISH: + filters: + branches: + only: master + - DOCS_PUBLISH: + filters: + branches: + only: master + - DOCKER_MASTER_PUBLISH: + requires: + - NPM_PUBLISH