如何在另一个仓库部署 github 页面

Hao*_* Yu 5 travis-ci github-pages

GitHub Pages 部署的文档来看,似乎可以将存储库 A 的应用程序部署到另一个存储库 B 的 github 页面。在我的用例中,我想部署到组织 github pages organization.github.io。由于组织 github pages 只接受master分支中的文件,我想在另一个 repo 上开发该应用程序。

所以在我的开发仓库(让我们称之为organization/app)中,我有这样的.travis.yml

language: node_js
node_js:
  - "node"
install:
  - npm install
script:
  - npm run lint
  - npm run build
deploy:
  provider: pages
  local-dir: dist
  github-token: $GITHUB_TOKEN
  skip-cleanup: true
  keep-history: true
  repo: organization/organization.github.io
  target-branch: master
  on:
    branch: master
Run Code Online (Sandbox Code Playgroud)

即使已经指定了repotarget-branch,Travis CI 仍然将所有构建文件部署到organization/app:gh-pages,而不是organization/organization.github.io:master.

对于真正的应用程序,请参阅此开发存储库CI 部署日志

Wal*_*ski 0

我有类似的问题。检查您是否使用正确的提交哈希运行构建。

通过重新启动构建,您将获得旧的提交集。

您可以设置flow触发构建的 a 或触发自定义构建。