Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skipping deployment with the npm provider because this branch is not permitted to deploy

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.

like image 758
Rana Avatar asked Jan 05 '15 03:01

Rana


1 Answers

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 to true, the application is deployed when a tag is applied to the commit. (Due to a known issue, you should also set all_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.

like image 98
Odi Avatar answered Nov 09 '22 04:11

Odi