Skip to main content

Сведения об ошибках сборки Jekyll для сайтов GitHub Pages

Если Jekyll обнаруживает ошибку при создании сайта GitHub Pages локально или на GitHub Enterprise Server, вы получите сообщение об ошибке, содержащее дополнительные сведения.

Кто может использовать эту функцию?

GitHub Pages доступен в общедоступных репозиториях с GitHub Free и GitHub Free для организаций, а также в общедоступных и частных репозиториях с GitHub Pro, GitHub Team, GitHub Enterprise Cloudи GitHub Enterprise Server.

About Jekyll build errors

If you are publishing from a branch, sometimes GitHub Pages will not attempt to build your site after you push changes to your site's publishing source.

  • You're pushing with a deploy key. If you want to automate pushes to your site's repository, you can set up a machine user instead. For more information, see Managing deploy keys.
  • You're using a CI service that isn't configured to build your publishing source. For example, Travis CI won't build the gh-pages branch unless you add the branch to a safe list. For more information, see Customizing the build on Travis CI, or your CI service's documentation.

Note

It can take up to 10 minutes for changes to your site to publish after you push the changes to GitHub Enterprise Server.

If Jekyll does attempt to build your site and encounters an error, you will receive a build error message. There are two main types of Jekyll build error messages.

  • A "Page build warning" message means your build completed successfully, but you may need to make changes to prevent future problems.
  • A "Page build failed" message means your build failed to complete. If Jekyll is able to detect a reason for the failure, you'll see a descriptive error message.

For more information about troubleshooting build errors, see Troubleshooting Jekyll build errors for GitHub Pages sites.

Viewing your repository's build failures on GitHub Enterprise Server

You can see build failures (but not build warnings) for your site on GitHub Enterprise Server in the Settings tab of your site's repository.

Viewing Jekyll build error messages locally

We recommend testing your site locally, which allows you to see build error messages on the command line, and addressing any build failures before pushing changes to GitHub Enterprise Server. For more information, see Testing your GitHub Pages site locally with Jekyll.

Viewing Jekyll build error messages in your pull request

If you are publishing from a branch, when you create a pull request to update your publishing source on GitHub Enterprise Server, you can see build error messages on the Checks tab of the pull request. For more information, see About status checks.

If you are publishing with a custom GitHub Actions workflow, in order to see build error messages in your pull request, you must configure your workflow to run on the pull_request trigger. When you do this, we recommend that you skip any deploy steps if the workflow was triggered by the pull_request event. This will allow you to see any build errors without deploying the changes from your pull request to your site. For more information, see Events that trigger workflows and Evaluate expressions in workflows and actions.

Viewing Jekyll build errors by email

If you are publishing from a branch, when you push changes to your publishing source on GitHub Enterprise Server, GitHub Pages will attempt to build your site. If the build fails, you'll receive an email at your primary email address.

Tip

You will only receive an email if outbound email support is enabled on your GitHub Enterprise Server instance. For more information, contact your site administrator.

If you are publishing with a custom GitHub Actions workflow, in order to receive emails about build errors in your pull request, you must configure your workflow to run on the pull_request trigger. When you do this, we recommend that you skip any deploy steps if the workflow was triggered by the pull_request event. This will allow you to see any build errors without deploying the changes from your pull request to your site. For more information, see Events that trigger workflows and Evaluate expressions in workflows and actions.

Viewing Jekyll build error messages in your pull request with a third-party CI service

You can configure a third-party service, such as Travis CI, to display error messages after each commit.

  1. If you haven't already, add a file called Gemfile in the root of your publishing source, with the following content:

    source `https://rubygems.org`
    gem `github-pages`
    
  2. Configure your site's repository for the testing service of your choice. For example, to use Travis CI, add a file named .travis.yml in the root of your publishing source, with the following content:

    language: ruby
    rvm:
      - 2.3
    script: "bundle exec jekyll build"
    
  3. You may need to activate your repository with the third-party testing service. For more information, see your testing service's documentation.