awesome-cordova-plugins/circle.yml
Ibby Hadeed ab74703841 ci(): change cache key for ionic-site repo
CircleCI can only save files one to a specific cache key. I set the cache key to depend on the checksum of package.json, so it updates the cache every time we update Ionic Native. In the long run, CircleCI will have to download the ionic-site changes less often.
2017-06-11 17:37:06 -04:00

49 lines
1.3 KiB
YAML

version: 2
jobs:
build:
working_directory: ~/ionic-native/
docker:
- image: node:7
steps:
- checkout
- restore_cache:
key: ionic-site-{{ checksum "package.json" }}
- run:
name: Prepare ionic-site repo
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
./scripts/docs/prepare.sh
fi
- save_cache:
key: ionic-site-{{ checksum "package.json" }}
paths:
- ~/ionic-site/
- restore_cache:
key: node_modules_{{ checksum "package.json" }}
- run:
name: Install node modules
command: npm i
- save_cache:
key: node_modules_{{ checksum "package.json" }}
paths:
- ~/ionic-native/node_modules/
- run:
name: Run tslint
command: npm run lint
- run: bash ./scripts/git/config.sh
- run:
name: Build Ionic Native
command: npm run build:core && ./node_modules/.bin/tsc
- run:
name: Run tests
command: npm test
- add_ssh_keys
- deploy:
name: Update docs
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
./scripts/docs/update_docs.sh
else
echo "We are on ${CIRCLE_BRANCH} branch, not going to update docs."
fi