【问题标题】:Can't build github page generic error无法构建 github 页面通用错误
【发布时间】:2018-11-07 17:02:48
【问题描述】:

我正在使用 travis CI 发布我的 jekyll 网站。

Whole repo.

相关部分是:

.travis.yml

language: ruby
rvm:
- 2.3.3

before_script:
 - chmod +x ./script/cibuild # or do this locally and commit

# Assume bundler is being used, therefore
# the `install` step will run `bundle install` by default.
script: ./script/cibuild

# branch whitelist, only for GitHub Pages
branches:
  only:
  - gh-pages     # test the gh-pages branch
  - /pages-(.*)/ # test every branch which starts with "pages-"

env:
  global:
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer

sudo: false # route your build to the container-based infrastructure for a faster build

deploy:
  provider: pages
  skip-cleanup: true
  github-token: $GITHUB_TOKEN  # Set in the settings page of your repository, as a secure variable
  keep-history: true
  on:
    branch: gh-pages

我的 cibuild 文件如下:

#!/usr/bin/env bash
set -e # halt script on error

bundle exec jekyll build

This is the full log of the build.

一切似乎部署正常,没有错误。

但在 Github 上我得到:

故障排除无济于事。

以防万一。我正在运行jekyll-assets,我不能直接使用 gh-pages 构建它,因此 travis,请参见 https://github.com/github/pages-gem/issues/189https://github.com/github/pages-gem/issues/189#issuecomment-319070628

实在不知道怎么处理,github的错误也无济于事。

【问题讨论】:

    标签: github jekyll travis-ci github-pages


    【解决方案1】:

    如果您的站点已经由 CI 构建,您可以在代码的根目录中添加一个 .nojekyll 文件,以指示 gh-pages 不生成,而只是发布您的站点。

    【讨论】:

    • 我会试一试。谢谢!
    • 嘿,这似乎解决了部分问题!谢谢一堆。我仍然不确定它到底在做什么。我还看到一个损坏的 md 文件:trufavarela.github.io/openbazaar 而不是生成的 html。
    • 这似乎与我在根目录下有这个 index.html 的事实有关
    • 我的意思是这个文件:github.com/trufavarela/openbazaar/commit/…
    • 您的 CI 应该发布生成的站点。 _site 文件夹的内容,而不是主分支代码。
    猜你喜欢
    • 2018-06-28
    • 2020-05-17
    • 1970-01-01
    • 1970-01-01
    • 2016-04-13
    • 1970-01-01
    • 2019-04-27
    • 2021-05-08
    • 2016-12-13
    相关资源
    最近更新 更多