Staging instances with now + travis
Each pull request gets it's own deployment instance https://{author}-{repo}-{branch-name}.now.sh
This is updated on every commit to the matching pull request.
The master branch is deployed on https://{author}-{repo}.now.sh
You need 2 tokens for now-cd
to work
-
now API token
You can generate a token from account/tokens. Call it
NOW_CD_TOKEN
-
Github API token
You can generate a token from settings/tokens/new, call it
NOW_CD_GITHUB_TOKEN
Now set these in travis repository settings This is how.
add this to .travis.yml
:
after_success:
- npx now-cd
use the --alias
option to set custom aliases per-branch:
npx now-cd --alias "master=myapp.com" --alias "staging=staging.myapp.com"
all commits to master will now be aliased to myapp.com
, and all commits to the staging branch will now be aliased to staging.myapp.com
!
use the --team
option to mention your team name
npx now-cd --team auth0-design
⭐ this repo
MIT © siddharthkp