使用 Travis CI 自动部署一些分支

Automatic deploy of some branches with Travis CI

我现在如何部署并且我知道如何只构建一些分支,但是有什么方法可以构建所有(或一些)分支并且只部署主分支的构建吗?

类似于部署白名单。

我在文档中发现,如果您使用 deploy 部分进行部署,您可以使用 on: 属性 进行条件发布并指定一个分支:

deploy:
  ...
  on:
    branch: master

Here is the link to the documentation.

希望对您有所帮助!