Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: 2.1
- executors:
- node:
- docker:
- - image: circleci/node:10.16
- commands:
- flow:
- parameters:
- environment:
- type: string
- default: "production"
- yarn:
- type: string
- default: "yarn prod-build"
- steps:
- - add_ssh_keys:
- fingerprints:
- - xxx
- - store_test_results:
- path: test-results
- - checkout
- - restore_cache:
- name: Restore Yarn Package & Packge.json Cache
- keys:
- - yarn-packages-{{ checksum "yarn.lock" }}
- - v1-dependencies-{{ checksum "package.json" }}
- - yarn-packages-
- - v1-dependencies-
- - run:
- name: Install Yarn Packages
- command: yarn install
- - run:
- name: Building Repo
- command: << parameters.yarn >>
- - save_cache:
- name: Save Yarn Package Cache
- key: dependency-cache-{{ checksum "package.json" }}
- paths:
- - ./node_modules
- - run:
- name: Run SSH keyscan
- command: ssh-keyscan ${hostname} >> ~/.ssh/known_hosts
- - run:
- name: Install Rysnc
- command: sudo apt-get install rsync
- - run:
- name: Upload files to theme folder
- command: rsync -avP --delete-before --exclude 'node_modules' --exclude '.git'
- --exclude 'webpack' --exclude '.circleci' --exclude 'src' --exclude '.babelrc'
- --exclude '.browserslistrc' --exclude '.eslintrc' --exclude '.gitignore'
- --exclude '.prettierrc' --exclude '.stylelintignore' --exclude '.stylelintrc'
- --exclude 'env.json' --exclude 'package.json' --exclude 'yarn.lock' --exclude
- 'README.md' ~/<< parameters.environment >>-theme ${username}@${hostname}:/var/www/html/${site_name}/wp-content/themes/
- jobs:
- production:
- executor: node
- working_directory: ~/production-theme
- steps:
- - flow:
- - environment: "production"
- - yarn: "yarn prod-build"
- development:
- working_directory: ~/develop-theme
- docker:
- - image: circleci/node:10.16
- steps:
- - flow:
- - environment: "develop"
- - yarn: "yarn test-build"
- workflows:
- version: 2
- production_and_development:
- jobs:
- - development:
- filters:
- branches:
- only: develop
- - production:
- filters:
- branches:
- only: master
Add Comment
Please, Sign In to add comment