Created
May 31, 2017 07:59
-
-
Save knowbody/304fd5417772da5cf637bec68320a799 to your computer and use it in GitHub Desktop.
Zeit now.sh and CircleCI config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
machine: | |
environment: | |
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin" | |
node: | |
version: 7.10.0 | |
dependencies: | |
override: | |
- yarn | |
cache_directories: | |
- ~/.cache/yarn | |
pre: | |
- yarn global add now | |
test: | |
override: | |
- yarn test | |
deployment: | |
development: | |
branch: master | |
commands: | |
- now -t ${NOW_TOKEN} | |
- now -t ${NOW_TOKEN} alias foo-dev | |
production: | |
branch: production | |
commands: | |
- now -t ${NOW_TOKEN} | |
- now -t ${NOW_TOKEN} alias foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"alias": [ | |
"foo", | |
"foo-dev" | |
], | |
"forwardNpm": true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This setup tells CircleCI to use
yarn
instead ofnpm
.It installs
now
globally, overrides the default test script withyarn test
.It deploy from two branches
master
andproduction
.To use
now alias
withoutnow alias set
, thealias
property needs to be set innow.json
.I also use
forwardNpm
flag, sonow
uses.npmrc
to access the private modules.NOW_TOKEN
was generated on the https://now.sh and is set as an env variable on CircleCI dashboard.