Skip to content

Commit

Permalink
Improve Yarn caching on Travis CI and Heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
larixer committed Jan 20, 2018
1 parent 584db96 commit 9cadab4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
before_install:
- eval "$(curl -sL https://raw.githubusercontent.com/colesbury/travis-remote-shell/master/run.sh)"
language: node_js
node_js:
- "node"
cache:
directories:
- node_modules/.cache
- $HOME/.cache/yarn
dist: trusty
os:
- linux
script:
- yarn seed
- yarn test
- yarn build
- yarn exp-publish
before_deploy: rm -rf .tmp node_modules build/client/ios build/client/android
deploy:
skip_cleanup: true
provider: heroku
api_key:
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=
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,7 @@ yarn start

### Deploying to [Heroku]

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

### Heroku Demo

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"rollback": "knex migrate:rollback",
"exp-login": "cross-env NODE_ENV=production spin exp login -u $EXP_USERNAME -p $EXP_PASSWORD --non-interactive",
"watch": "spin watch",
"heroku-postbuild": "rm -rf build && npm run exp-login && npm run build && npm run exp -- p --non-interactive && npm run seed",
"exp-publish": "npm run exp-login && npm run exp -- p --non-interactive",
"heroku-postbuild": "NODE_ENV=production npm run seed",
"precommit": "lint-staged",
"cli": "node tools/cli",
"postinstall": "opencollective postinstall",
Expand Down Expand Up @@ -70,6 +71,7 @@
"apollo-logger": "0.1.1",
"apollo-server-express": "^1.3.2",
"apollo-upload-server": "^3.0.0",
"babel-polyfill": "^6.26.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.2",
"bootstrap": "4.0.0-beta.2",
Expand Down Expand Up @@ -150,7 +152,6 @@
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-react-remove-prop-types": "^0.4.12",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-flow": "^6.23.0",
"babel-preset-minify": "^0.2.0",
Expand Down

0 comments on commit 9cadab4

Please sign in to comment.