Skip to content

Commit 2b7f3c2

Browse files
authored
Merge pull request #61 from textbook/fix-deps-caching
Restore caching of Yarn dependencies
2 parents 98de0ac + 8040aaf commit 2b7f3c2

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.circleci/config.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,22 @@ commands:
2424
--paths /\*
2525
2626
jobs:
27-
test:
27+
build:
2828
docker:
2929
- image: circleci/node:11.12
3030
working_directory: ~/repo
3131
steps:
3232
- checkout
33+
- restore_cache:
34+
keys:
35+
- yarn-dependencies-{{ checksum "package.json" }}
3336
- run:
34-
name: Install dependencies for lint and test
37+
name: Install dependencies
3538
command: yarn
39+
- save_cache:
40+
key: yarn-dependencies-{{ checksum "package.json" }}
41+
paths:
42+
- ~/.cache
3643
- run:
3744
name: Set env variables
3845
command: echo 'export VERSION=$(echo $CIRCLE_SHA1 | cut -c -7)' >> $BASH_ENV
@@ -92,20 +99,20 @@ workflows:
9299
version: 2
93100
test_and_deploy:
94101
jobs:
95-
- test:
102+
- build:
96103
context: build
97104
- deploy_staging:
98105
context: deployments_staging
99106
requires:
100-
- test
107+
- build
101108
filters:
102109
branches:
103110
only:
104111
- staging
105112
- deploy_production:
106113
context: deployments
107114
requires:
108-
- test
115+
- build
109116
filters:
110117
branches:
111118
only:

0 commit comments

Comments
 (0)