Unless you want to modify .travis.yml
, it is simpler that you use the gulp deploy script (as documented in the README) to push to your own personal github page. This guide is written for developers who want to test out their changes on .travis.yml
.
If you are new to Travis, go through the getting started guide first to setup Travis in your repository.
Note: only git pushes to
dev
andmaster
will trigger travis build. You can change this inbranches:
inside.travis.yml
(remember to revert when you send PR to production!).
We use Coveralls for code coverage, but this will break your travis script if you run it anywhere other than in binary-com/binary-next-gen. You could sign up for an account and register your repository, but a simpler way is just to turn it off while you develop:
# - yarn test:coveralls
The travis script on the main branch sends notifications to Binary developers when the build completes. You may not want this behaviour when deploying to your personal github page. To disable them, remove or comment out the blocks with notifications
(there are 2 of them in the script).
The travis script uses an access token for binary-com/binary-next-gen (we would not want everyone to have write access to that repo!). It is saved as a encrypted global environment variable GIT_KEY
. To deploy to your own github pages, you will need to create your own personal access token for your repo. Refer to github docs to generate your access token.
Once you do that, we can use travis commandline tools (install via gem install travis
) to encrypt your global environment variable GIT_KEY
, where GIT_KEY
is your secret access token:
travis encrypt GIT_KEY=abc123ThisIsYourTopSecretOAuthKeyYoYoYo
If prompted on username/repo_name, just enter yes
.
Add
-r owner/repo_name
to theencrypt
command if you intend the cipher text to be visible in another repo.
This will generate the cipher text secure: Ui89adAcRyPtIcJiBbEr1sH...
. Use that to replace the one inside the env: global:
block. Inside travis, that chunk of cipher text will be decrypted to GIT_KEY=abc123...
.