# Github Personal pages - Skipping a deployment with the pages provider because this branch is not permitted

**URL:** <https://travis-ci.community/t/github-personal-pages-skipping-a-deployment-with-the-pages-provider-because-this-branch-is-not-permitted/8192>\
**Category:** Deployment\
**Tags:** github-integration\
**Created:** [April 17, 2020, 9:55am UTC](https://travis-ci.community/t/github-personal-pages-skipping-a-deployment-with-the-pages-provider-because-this-branch-is-not-permitted/8192 "2020-04-17T09:55:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![samolego](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/samolego/32/4352_2.png) [@samolego](https://travis-ci.community/u/samolego)\
**Post date:** [April 17, 2020, 9:55am UTC](https://travis-ci.community/t/github-personal-pages-skipping-a-deployment-with-the-pages-provider-because-this-branch-is-not-permitted/8192/1 "2020-04-17T09:55:33Z")

</div>

Hi,

I recently found out travis ci, but I’m having some problems as a newbie.

I have a personal github page ([username.github.io](http://username.github.io)), which is a public repo. Github requires personal pages to be published from the master branch.  
Since I’m using Angular, I’d like to have a source code available, so I have made a new default branch called `angular-src`.

My idea was; travis grabs src from `angular-src` branch, builds it and then deploys it to `master` branch, so as to allow it to be published.

The github\_token value is indeed allowed for angular-src.  
Build works just fine, but when deploying, I get the error  
`Skipping a deployment with the pages provider because this branch is not permitted: angular-src`  
I’ve also added `branch-protection-rule` with flag `Allow force pushes: true` for master.

This is the build URL: [https://travis-ci.org/github/samolego/samolego.github.io/jobs/676120027](https://travis-ci.org/github/samolego/samolego.github.io/jobs/676120027)  
My travis.yml can be seen at [https://github.com/samolego/samolego.github.io/blob/angular-src/.travis.yml](https://github.com/samolego/samolego.github.io/blob/angular-src/.travis.yml)

What can I do to grant the permission?  
Thanks in advance.

---

<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:** [April 18, 2020, 9:17pm UTC](https://travis-ci.community/t/github-personal-pages-skipping-a-deployment-with-the-pages-provider-because-this-branch-is-not-permitted/8192/2 "2020-04-18T21:17:14Z")

</div>

> **[Travis CI Documentation](https://docs.travis-ci.com/user/deployment/#conditional-releases-with-on)**
>
> Deployment

  
You need to specify the branch(es) that can trigger deployments in  

> <https://github.com/samolego/samolego.github.io/blob/9215f882b3a6ca6b1d5033c9ee0dd6af63d1cf92/.travis.yml#L21-L26>

  
without `on.branch`, only the `master` branch is allow to fire deployments.

---

<div class="post-metadata">

**Author:** ![samolego](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/samolego/32/4352_2.png) [@samolego](https://travis-ci.community/u/samolego)\
**Post date:** [April 19, 2020, 6:57pm UTC](https://travis-ci.community/t/github-personal-pages-skipping-a-deployment-with-the-pages-provider-because-this-branch-is-not-permitted/8192/3 "2020-04-19T18:57:30Z")

</div>

Hi. First I’d like to thank you for the answer, but I still can’t get it to work. I have set the custom config to `deploy.on.branch` to master, but it still fails, this time with empty log. I have restarted the build twice, but log is again empty … Do you know what I’m doing wrong besides the previous issue? Thank you so much.

Build URL(check the config used there, not on github): [https://travis-ci.org/github/samolego/samolego.github.io/jobs/676968007](https://travis-ci.org/github/samolego/samolego.github.io/jobs/676968007)

---

<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:** [April 20, 2020, 12:26pm UTC](https://travis-ci.community/t/github-personal-pages-skipping-a-deployment-with-the-pages-provider-because-this-branch-is-not-permitted/8192/4 "2020-04-20T12:26:33Z")

</div>

Did you read the document?

It should explain that what you need is something like:

```auto
deploy:
  provider: pages
  strategy: git
  cleanup: false
  token: $github_token
  local_dir: docs/
  on:
    branch: angular-src

```

---

<div class="post-metadata">

**Author:** ![samolego](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/samolego/32/4352_2.png) [@samolego](https://travis-ci.community/u/samolego)\
**Post date:** [April 21, 2020, 6:38am UTC](https://travis-ci.community/t/github-personal-pages-skipping-a-deployment-with-the-pages-provider-because-this-branch-is-not-permitted/8192/5 "2020-04-21T06:38:46Z")

</div>

Hi, sorry to bother you again. I misunderstood the docs and thought you can do “cross-branch-deployment” with that option. Now the deployment is working, however, it’s deploying the build to gh-pages. Is it possible to change that or not? (Like, instead of deploying to gh-pages branch, to deploy on master branch).

Thank you for your time & answers you’ve provided.

---

<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:** [April 21, 2020, 12:14pm UTC](https://travis-ci.community/t/github-personal-pages-skipping-a-deployment-with-the-pages-provider-because-this-branch-is-not-permitted/8192/6 "2020-04-21T12:14:04Z")

</div>

> [@samolego](#):
>
> Is it possible to change that or not?

> **[Travis CI Documentation](https://docs.travis-ci.com/user/deployment/pages#further-configuration)**
>
> GitHub Pages Deployment

The option you’re looking for is `target_branch`.

---

<div class="post-metadata">

**Author:** ![samolego](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/samolego/32/4352_2.png) [@samolego](https://travis-ci.community/u/samolego)\
**Post date:** [April 21, 2020, 3:18pm UTC](https://travis-ci.community/t/github-personal-pages-skipping-a-deployment-with-the-pages-provider-because-this-branch-is-not-permitted/8192/7 "2020-04-21T15:18:40Z")

</div>

Thank you!
