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), 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
My travis.yml can be seen at https://github.com/samolego/samolego.github.io/blob/angular-src/.travis.yml
What can I do to grant the permission?
Thanks in advance.
You need to specify the branch(es) that can trigger deployments in
without on.branch
, only the master
branch is allow to fire deployments.
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
Did you read the document?
It should explain that what you need is something like:
deploy:
provider: pages
strategy: git
cleanup: false
token: $github_token
local_dir: docs/
on:
branch: angular-src
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.
The option you’re looking for is target_branch
.