github-actionsgithub-pages

Configure GitHub Pages failed


I was trying to use GitHub Pages (Static HTML By GitHub Actions) and facing this error.

Run actions/configure-pages@v2.1.1
Warning: Get Pages site failed
Error: Create Pages site failed
Error: AxiosError: Request failed with status code 403

Any idea how to resolve it? All I have in my repository is a simple index.html which says:

<h1>Hello </h1>

Configure GitHub pages failed


Solution

  • I had a similar issue and I think I found a solution.

    I created a website project using next.js and I wanted some students I'm teaching to fork the project and be able to have their own sites too. The build worked on my site, but kept failing on the forked sites.

    So we went into Settings/Pages in the forked projects and set the Source to GitHub Actions.

    Screenshot of setting

    I had done this on the original project and used a template to make the workflow file, but it seems you need to do this again when forking the project (or adding the workflow file manually).