# Gh-pages 404

**URL:** <https://discourse.gohugo.io/t/gh-pages-404/38766>\
**Category:** support\
**Created:** [May 24, 2022, 9:27am UTC](https://discourse.gohugo.io/t/gh-pages-404/38766 "2022-05-24T09:27:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![lexahl](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/lexahl/32/14308_2.png) [@lexahl](https://discourse.gohugo.io/u/lexahl)\
**Post date:** [May 24, 2022, 9:27am UTC](https://discourse.gohugo.io/t/gh-pages-404/38766/1 "2022-05-24T09:27:39Z")

</div>

gh-pages wont deploy site! I think I’ve tried everything but I keep getting 404:

- I added the .nojekyll file (and tried adding a jekyll theme too while having and not having the .nojekyll file because)
- I added a Github Action Workflow
- theme is connected with a submodule

Everything runs great locally, here is the public repo [GitHub - lexahl/1](https://github.com/lexahl/1)

Site should be here [https://lexahl.github.io/1/](https://lexahl.github.io/1/)

I think I need a second (or third) set of eyes looking at this - thank you!!

---

<div class="post-metadata">

**Author:** ![idarek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/idarek/32/26229_2.png) [@idarek](https://discourse.gohugo.io/u/idarek)\
**Post date:** [May 24, 2022, 10:01am UTC](https://discourse.gohugo.io/t/gh-pages-404/38766/2 "2022-05-24T10:01:25Z")

</div>

If you look into your config, you are lacking `baseURL = ""`.  
I would start with setting this up to `https://lexahl.github.io/1/` ?

---

<div class="post-metadata">

**Author:** ![lexahl](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/lexahl/32/14308_2.png) [@lexahl](https://discourse.gohugo.io/u/lexahl)\
**Post date:** [May 24, 2022, 10:02am UTC](https://discourse.gohugo.io/t/gh-pages-404/38766/3 "2022-05-24T10:02:24Z")

</div>

I have base url “” on the main branch to test on netlify, on the gh-pages branch it is set to [https://lexahl.github.io/1/](https://lexahl.github.io/1/), and the deploy for gh pages is on that branch, thanks for the suggestion though :))

---

<div class="post-metadata">

**Author:** ![frjo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frjo/32/18626_2.png) [@frjo](https://discourse.gohugo.io/u/frjo)\
**Post date:** [May 24, 2022, 1:06pm UTC](https://discourse.gohugo.io/t/gh-pages-404/38766/4 "2022-05-24T13:06:46Z")

</div>

You are using [GitHub Pages action · Actions · GitHub Marketplace · GitHub](https://github.com/marketplace/actions/github-pages-action). That action deployed your site **to** the gh-pages branch. The gh-pages branch then contains whatever Hugo generated in the “public” director.

Your “gh-pages.yml” workflow also checks that the deploying branch is “main” but your default branch is named “master”.

> <https://github.com/lexahl/1/blob/e7c9b2ebb7128ddf7b61a8a5a0a04f9619f5db3b/.github/workflows/gh-pages.yml#L29>

---

<div class="post-metadata">

**Author:** ![lexahl](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/lexahl/32/14308_2.png) [@lexahl](https://discourse.gohugo.io/u/lexahl)\
**Post date:** [May 24, 2022, 1:19pm UTC](https://discourse.gohugo.io/t/gh-pages-404/38766/5 "2022-05-24T13:19:39Z")

</div>

i changed main to master, but still not working…

---

<div class="post-metadata">

**Author:** ![frjo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frjo/32/18626_2.png) [@frjo](https://discourse.gohugo.io/u/frjo)\
**Post date:** [May 24, 2022, 1:43pm UTC](https://discourse.gohugo.io/t/gh-pages-404/38766/6 "2022-05-24T13:43:40Z")

</div>

You missed the first part of my post. This line need to be changed to “master”.

> <https://github.com/lexahl/1/blob/c2671d91cfc121efdacb07f68b7de4fec49ad670/.github/workflows/gh-pages.yml#L6>

---

<div class="post-metadata">

**Author:** ![lexahl](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/lexahl/32/14308_2.png) [@lexahl](https://discourse.gohugo.io/u/lexahl)\
**Post date:** [May 25, 2022, 7:10am UTC](https://discourse.gohugo.io/t/gh-pages-404/38766/7 "2022-05-25T07:10:22Z")

</div>

ah ok - i tried changing that too but it also made no difference… ☹

---

<div class="post-metadata">

**Author:** ![frjo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frjo/32/18626_2.png) [@frjo](https://discourse.gohugo.io/u/frjo)\
**Post date:** [May 25, 2022, 7:31am UTC](https://discourse.gohugo.io/t/gh-pages-404/38766/8 "2022-05-25T07:31:18Z")

</div>

It still say “gh-pages”:

> <https://github.com/lexahl/1/blob/f33441f5c69bb0975a6930cdaa938a55adcbec54/.github/workflows/gh-pages.yml#L6>

---

<div class="post-metadata">

**Author:** ![frjo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frjo/32/18626_2.png) [@frjo](https://discourse.gohugo.io/u/frjo)\
**Post date:** [May 25, 2022, 7:33am UTC](https://discourse.gohugo.io/t/gh-pages-404/38766/9 "2022-05-25T07:33:19Z")

</div>

It is on the master branch you need to make the change.

That is the branch you should deploy from.

On each deploy the workflow will override anything in the gh-pages branch with the generated site, i.e. the content of the “public” folder.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [May 27, 2022, 7:33am UTC](https://discourse.gohugo.io/t/gh-pages-404/38766/10 "2022-05-27T07:33:31Z")

</div>

Closed on May 27, 2022, 7:33am UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
