# Travis is skipping our companies S3 deployment because branch is not permitted

**URL:** https://travis-ci.community/t/travis-is-skipping-our-companies-s3-deployment-because-branch-is-not-permitted/12697
**Category:** Deployment
**Created:** [February 17, 2022, 6:59pm UTC](https://travis-ci.community/t/travis-is-skipping-our-companies-s3-deployment-because-branch-is-not-permitted/12697 "2022-02-17T18:59:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Spineswitch](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/spineswitch/32/7693_2.png) [@Spineswitch](https://travis-ci.community/u/Spineswitch)
#### Post date: [February 17, 2022, 6:59pm UTC](https://travis-ci.community/t/travis-is-skipping-our-companies-s3-deployment-because-branch-is-not-permitted/12697/1 "2022-02-17T18:59:38Z")

</div>

I have a new issue with a Travis build. In brief, my `.travis.yml` file contains (I’ve removed all secrets and sensitive information):

```auto
deploy:
  provider: s3

    branch: staging

deploy:
  provider: s3
  local_dir: dist/
  acl: public_read
  on:
    branch: master

```

Until Feb 15th 2022 this setup worked as intended (staging branch was deployed to the `my-bucket-staging` bucket, master branch was deployed to the `my-bucket` bucket, and all other branches were ignored). My `.travis.yml` file hasn’t changed since Jan 13, but the `staging` branch stopped deploying with the message `Skipping a deployment with the S3 provider because this branch is not permitted` on Feb 16th. My last known successful deployment was on Feb 15th.

I’ve read thru the docs, still don’t get it? What am I missing here?

---

<div class="post-metadata">

### Author: ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)
#### Post date: [February 17, 2022, 7:02pm UTC](https://travis-ci.community/t/travis-is-skipping-our-companies-s3-deployment-because-branch-is-not-permitted/12697/2 "2022-02-17T19:02:17Z")

</div>

The above Travis config defines two identical keys `deploy` , so only the last one is effective; meaning, there is no deployment provider defined with `on.branch: staging` as far as your `.travis.yml` is concerned, as this was how Travis was designed, to reiterate your second `deploy` is not being parsed by Travis, and rightfully so.

Now if you want to define two deployment providers that work on different branches, you need a 2-element array under `deploy`, here’s an example:

```nohighlight
deploy:
  - provider: s3
    access_key_id: mYacc3ssKeyID
    secret_access_key:
      secure: mYacc3ssKey
    bucket: my-bucket-staging
    skip_cleanup: true
    local_dir: dist/
    acl: public_read
    on:
      branch: staging
  - provider: s3
    access_key_id: mYOtheracc3ssKeyID
    secret_access_key:
      secure: mYOtheracc3ssKey
    bucket: my-bucket
    skip_cleanup: true
    local_dir: dist/
    acl: public_read
    on:
      branch: master

```

It is not clear to me how it could have been working before with your original configuration as indicated. I would be interested in seeing your build logs from January 2022.

---

<div class="post-metadata">

### Author: ![Spineswitch](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/spineswitch/32/7693_2.png) [@Spineswitch](https://travis-ci.community/u/Spineswitch)
#### Post date: [February 18, 2022, 10:00pm UTC](https://travis-ci.community/t/travis-is-skipping-our-companies-s3-deployment-because-branch-is-not-permitted/12697/3 "2022-02-18T22:00:43Z")

</div>

No reason to be a bit rude, your post did solve my issue though.
