# Conditional Deployment not working

**URL:** <https://travis-ci.community/t/conditional-deployment-not-working/1085>\
**Category:** Deployment\
**Tags:** script-deployment\
**Created:** [November 27, 2018, 8:31am UTC](https://travis-ci.community/t/conditional-deployment-not-working/1085 "2018-11-27T08:31:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![raphi011](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/raphi011/32/42_2.png) [@raphi011](https://travis-ci.community/u/raphi011)\
**Post date:** [November 27, 2018, 8:31am UTC](https://travis-ci.community/t/conditional-deployment-not-working/1085/1 "2018-11-27T08:31:42Z")

</div>

Hi guys, I have [this](https://github.com/raphi011/scores/blob/development/.travis.yml) travis file and somehow my conditional deployment is not working - it starts the deployment job on every commit.

I want it to only trigger on tagged commits on the ‘development’ branch.

What am I doing wrong?

[Here](https://travis-ci.org/raphi011/scores/builds/460134206) is an example build.

EDIT:  
It didn’t work because the `deploy` field was indented wrongely … what I also didn’t know was that the job will always appear even if the ‘on’ condition doesn’t apply.

In case you want the job only to show up when it really is run then use the `if` field like [so](https://github.com/raphi011/scores/blob/cafefb876a6f8fbd7a3f0cd010be55544fced2d4/.travis.yml#L20)

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [November 27, 2018, 2:16pm UTC](https://travis-ci.community/t/conditional-deployment-not-working/1085/2 "2018-11-27T14:16:18Z")

</div>

Your [deployment configuration](https://github.com/raphi011/scores/blob/cafefb876a6f8fbd7a3f0cd010be55544fced2d4/.travis.yml#L31-L35) still needs some work. Namely, it needs to be a single command, as described in [https://docs.travis-ci.com/user/deployment/script](https://docs.travis-ci.com/user/deployment/script).
