github-pages-deploy-action: GitHub Pages build failed

What’s the problem?

Every time an action is triggered, I get the “Your site is having problems building: Page build failed.” error.

I tried to replace GITHUB_TOKEN: ${{ secret.GITHUB_TOKEN }} with ACCESS_TOKEN: ${{ secret.REPO_SCOPED_TOKEN }}.

Didn’t help.

I tried to add a .nojekyll file to the build.

Didn’t help.

I tried using JamesIves/github-pages-deploy-action@releases/v3.

Didn’t help.

I tried to add a .nojekyll file directly to gh-pages branch.

But,

You can safely commit these files directly into deployment branch without them being overridden after each deployment

is definitely not true. All files are erased every time.

Expected behavior

No errors will occur after deployment.

Therefore, I would appreciate any help in solving this problem.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 9
  • Comments: 21 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve noticed this too and I’ve been holding back on releasing the new version because of it. I’ve emailed GitHub support about it with a very vague response from them. It seems like something has changed this last week, because previously the error was only caused if you are using a GitHub token, but they told me it’s because a human didn’t trigger the build even though an access token with a very greedy permission scope was used.

Oh interesting - we'll dig into this more and followup if we have more questions.

I’ve also posted about it here: https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/m-p/38065/highlight/true#M3210 and here: https://github.community/t5/GitHub-Pages/Cannot-Build-Page/m-p/37618#M2324 but have yet to receive any actionable response.

@tcbyrd - If you’re available are you able to look into this? I have a test repo with the issue: https://github.com/JamesIves/doughnut-generator

And yes, I forgot to mention, if I make any changes to the gh-pages branch after deployment, the error disappears.

I used v2 and releases/v3 of github-pages-deploy-action with checkout@v1 to no avail. Getting the same error 'GitHub Pages build failed'. Heres an example project. Its hosted on shilangyu.dev/actions-testing and you can see the content does not match the gh-pages branch.

Try changing GITHUB_TOKEN out for a personal access token in the deploy step and it should work.

Just got word back from GitHub support. Essentially what’s happening here is that the GITHUB_TOKEN is being persisted by another action, causing the failure when it gets to the deploy step because of the existence of a GITHUB_TOKEN.

Update the actions/checkout step in your config to point to v1 and this issue should be resolved.

    steps:
    - name: Checkout
      uses: actions/checkout@v1

Just tested it and it worked for me. Please let me know if you have similar luck, I’ve updated the action config examples in the README if you want to take a look there.

With that being said I’m going to push up v3 today.

This seems to be a problem for all gh-pages deploy actions. Switching to master branch in settings/Github_Pages and then switching back to gh-pages cause it to deploy correctly

Try changing GITHUB_TOKEN out for a personal access token in the deploy step and it should work.

This does work. Let’s hope GITHUB_TOKEN gets a fix soon

I also got depressed by this problem…, I found something special, the first time you run the action in v2/v3, the page will be built successfully, but if u update sth and push, when the action goes there will be one more workflow ‘github pages’, although it shows success the page still failed in building. image