Answer the question
In order to leave comments, you need to log in
How to write a config for travis ci?
How to correctly write a config for the following behavior:
Any commit or PR triggers tests npm run tests
If something with the tag tag is pushed to the master branch Run tests, build, deploy to production with a command , and deploy
to npm run deploy
GitHub Releases
run twice with one different environment variable. BROWSER
That is, as I see it:
I commit to any branch - two parallel tests run BROWSER=chrome npm run tests
BROWSER=firefox npm run tests
Someone makes a PR to any branch - two parallel tests run BROWSER=chrome npm run tests
BROWSER=firefox npm run tests
I commit to the master with a tag - runs two parallel tests BROWSER=chrome npm run tests
BROWSER=firefox npm run tests
If both tests pass, two commands are launched to deploy BROWSER=chrome npm run deploy
BROWSER=firefox npm run deploy
AND the third command is to create a release on GitHub
I am not familiar with this tool at all. Wrote this config
language: node_js
node_js:
- "10"
env:
- BROWSER=chrome
- BROWSER=firefox
script: npm run build
deploy:
skip_cleanup: true
provider: script
script: npm run deploy
on:
branch: master
Answer the question
In order to leave comments, you need to log in
Look at https://docs.travis-ci.com/user/build-stages/.
As far as I understand, you should have stages:
- test (with two browsers)
- build
- deploy (only if branch=master)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question