How to use travis-conditions with deploy tool?

Can the travis-conditions syntax be used for setting a deployment condition?

So can this here:

deploy:
  provider: script
  script: deploy.sh
  on:
    all_branches: true
    condition: $TRAVIS_BRANCH =~ ^staging|production$

Be turned into the following?

deploy:
  provider: script
  script: deploy.sh
  on:
    all_branches: true
    condition: branch IN (staging, production)