Travis CI-将GitHub从dev推送到master分支

问题描述 投票:1回答:1

我在GitHub中有一个R包,我想确保master分支中的每个提交都已成功地在Travis CI上构建。

所以我虽然专门在“ dev”分支上工作,但每次提交时,让Travis CI建立并在成功后推送到master分支。

但是,我是没有成功的人。

我尝试了多种方法(thisthisthisthisthis),但所有方法都失败了。

[为了获得更多信息,我还希望Travis CI将一个由jekyll生成的网站部署到gh-pages分支(如果我按下master,它现在可以正确运行)。

如何完成?

谢谢。

r github continuous-integration travis-ci
1个回答
0
投票

默认情况下,Travis CI根据master分支上的提交更改将其推送到GitHub repo gh-pages分支。这就是您由jekyll生成的网站能够推入gh-pages分支的原因。

在您的情况下,您希望Travis CI根据dev分支上的提交更改将其推送到GitHub repo master分支。

这需要在。travis.yml中执行以下Travis CI配置:

language: r
...
...
...
deploy:
  provider: pages
  skip_cleanup: true
  keep_history: true
  github_token: $github_token  # Your GitHub token set in Travis CI console
  target_branch: master        # Push into GitHub repo master branch
  on:
    branch: dev                # Your GitHub repo default branch
© www.soinside.com 2019 - 2024. All rights reserved.