Deployment fails because of unallowed branch

Hey there.
The thing is pretty straight forward. I’ve been following docs on deploying different environments.
i’ve made up a travic config that looks like this:

#!/usr/bin/env bash
language: node_js
node_js:
    - "8"
addons:
    ssh_known_hosts: mywebsite.com

branches:
    only:
        - master
        - develop
after_success:
    - npm run build:prod

deploy:
    - provider: script
      skip_cleanup: true
      script: bash ./deploy.sh production
      on:
        branch: master
    - provider: script
      skip_cleanup: true
      script: bash ./deploy.sh stage
      on:
        branch: develop

So basically all I wanna do is restrict travis to build only branches that are develop and master. Once only master and develop branches are build, I’d like them to have different deployment configs, and so my whole deploy section is basically copy-paste from your docs.
Now, as far as restricting only develop and master branches work, because my other branches don’t get build, the develop still can’t get deployed. No matter if I remove

branches:
    only:
        - master
        - develop

this section or not. Everything comes from docs, so why won’t it work? Am I missing something here?