Skip to content

Commit 54a5589

Browse files
committed
Improve Yarn caching on Travis CI and Heroku
1 parent 584db96 commit 54a5589

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1+
before_install:
2+
- eval "$(curl -sL https://raw.githubusercontent.com/colesbury/travis-remote-shell/master/run.sh)"
13
language: node_js
24
node_js:
35
- "node"
6+
cache:
7+
directories:
8+
- node_modules/.cache
9+
- $HOME/.cache/yarn
410
dist: trusty
511
os:
612
- linux
713
script:
8-
- yarn seed
914
- yarn test
15+
- yarn build
16+
- yarn exp-publish
17+
before_deploy: rm -rf .tmp node_modules build/client/ios build/client/android
1018
deploy:
19+
skip_cleanup: true
1120
provider: heroku
1221
api_key:
1322
secure: fNhB+2DcXLoez7unhEMEUlL8WRBdWADn3Ye5Bm5MzFXVY2ZbjhhBaTo/v1XOHKRO/JrLNe7pzoaqwONWbhSTOe8sKBawUNQUAtcaR1MhZeLaCNGACblhc8YYffm4oRvwdv/N6GYZKo2aUsDwgkZmNu4GJFi3eBNXHaVobnzU09nnrs2WHm0JIiDs23z7TcIjTqC8sa7D7Q7LFeNhtsJl54s2s1wGfzEdhkPqc4OGM/87tLgtdwnCTPQs/nbetr6BfFndrT3fYmVbuFe6m4/e94eZHr7D/c2eiWEyb4FZv0FLkndY/7PCV0egUs1uSYkQeQcE2eAv5ZacgqYA9miFw3bhTEinM1ud0CfOxnYYtwniR4X0XxuHMpsVU71olChWnSwt7TvJG/uncjfvmWzWX+VA9f+n6Ya5+C893rledOLMrwJN6R+bqGLxBC0dwFI1Cfhxb/Io4/PjgmK0NNiSWJ+UCr26IEzKEAi7dz0zUqCDdykH9Co7R/hTeBT/rMrE0SYumc66Or4nhZohEFzdQSRBKtG+6xAcmMkLtut15grsxJ9+OvZUIIEoB2PFKuh4ephskEo5UQUQzVJscuFtDC+VIf+4vRwP8lvkV7LF6M8mN3FMyHwDb4+/q9lKIRAu4/fGY8P4NGrMSBgkgQI7CANgDj1mIROPsSVd4JVnpMc=

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -441,12 +441,7 @@ yarn start
441441

442442
### Deploying to [Heroku]
443443

444-
1. Add your app to Heroku
445-
1. Allow Heroku to install build time dependencies from the devDependencies in `package.json`: `Settings -> Config
446-
Variables -> Add`, KEY: `YARN_PRODUCTION`, VALUE: `false`.
447-
1. Add `EXP_USERNAME` and `EXP_PASSWORD` config variables there as well. They will be used to publish mobile Expo Client
448-
applications
449-
1. Deploy your app on Heroku
444+
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
450445

451446
### Heroku Demo
452447

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"rollback": "knex migrate:rollback",
2222
"exp-login": "cross-env NODE_ENV=production spin exp login -u $EXP_USERNAME -p $EXP_PASSWORD --non-interactive",
2323
"watch": "spin watch",
24-
"heroku-postbuild": "rm -rf build && npm run exp-login && npm run build && npm run exp -- p --non-interactive && npm run seed",
24+
"exp-publish": "npm run exp-login && npm run exp -- p --non-interactive",
25+
"heroku-postbuild": "NODE_ENV=production npm run seed",
2526
"precommit": "lint-staged",
2627
"cli": "node tools/cli",
2728
"postinstall": "opencollective postinstall",
@@ -70,6 +71,9 @@
7071
"apollo-logger": "0.1.1",
7172
"apollo-server-express": "^1.3.2",
7273
"apollo-upload-server": "^3.0.0",
74+
"babel-polyfill": "^6.26.0",
75+
"babel-preset-env": "^1.6.1",
76+
"babel-register": "^6.26.0",
7377
"bcryptjs": "^2.4.3",
7478
"body-parser": "^1.18.2",
7579
"bootstrap": "4.0.0-beta.2",
@@ -150,14 +154,11 @@
150154
"babel-plugin-transform-decorators-legacy": "^1.3.4",
151155
"babel-plugin-transform-react-remove-prop-types": "^0.4.12",
152156
"babel-plugin-transform-runtime": "^6.23.0",
153-
"babel-polyfill": "^6.26.0",
154-
"babel-preset-env": "^1.6.1",
155157
"babel-preset-flow": "^6.23.0",
156158
"babel-preset-minify": "^0.2.0",
157159
"babel-preset-react": "^6.24.1",
158160
"babel-preset-react-native": "^4.0.0",
159161
"babel-preset-stage-0": "^6.24.1",
160-
"babel-register": "^6.26.0",
161162
"caporal": "^0.9.0",
162163
"chai": "^4.1.2",
163164
"chai-http": "^3.0.0",

tools/webpackAppConfig.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ const dependencyPlatforms = {
4242
antd: 'web',
4343
'antd-mobile': ['ios', 'android'],
4444
'apollo-engine': 'server',
45+
'babel-polyfill': 'server',
46+
'babel-preset-env': 'server',
47+
'babel-register': 'server',
4548
bcryptjs: 'server',
4649
'body-parser': 'server',
4750
bootstrap: 'web',

0 commit comments

Comments
 (0)