I am trying to build and deploy my npm package to npm registry automatically upon push to master branch.
Here is my .travis.yml
file content:
language: node_js
node_js:
- '0.11'
- '0.10'
deploy:
provider: npm
api_key:
secure: XXX
on:
tags: true
branch: master
The build runs successfully, but the deployment fails with message:
Skipping deployment with the npm provider because this branch is not permitted to deploy.
Why is that? I tried both without specifying any branch and specifying 'master' branch explicitly.
Here is the travis build status in details.
Any suggestion/clue to solve this issue is appreciated. Thanks in advance.
With tags: true
you specify, that only tagged commits will be deployed. If I'm not mistaken, Travis CI does not explicitly check on which branch such a commit is on. So either specify tags: true
, then make a tagged commit OR specify branch: master
and commit to this branch to trigger a deployment.
But using both statements won't work.
You can find a note in the Travis CI documentation (similar for GitHub) stating:
tags
: When set totrue
, the application is deployed when a tag is applied to the commit. (Due to a known issue, you should also setall_branches: true
.)
So the correct answer is to specify either a branch OR use tags: true
and all_branches: true
.
If you're using GitHub:
Please note that deploying GitHub Releases works only for tags, not for branches.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With