# Hosting on Github: Why github actions needed?

**URL:** <https://discourse.gohugo.io/t/hosting-on-github-why-github-actions-needed/33250>\
**Category:** support\
**Created:** [June 6, 2021, 7:37am UTC](https://discourse.gohugo.io/t/hosting-on-github-why-github-actions-needed/33250 "2021-06-06T07:37:18Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [June 6, 2021, 10:40pm UTC](https://discourse.gohugo.io/t/hosting-on-github-why-github-actions-needed/33250/4 "2021-06-06T22:40:33Z")

</div>

I have set up many Hugo sites on GitHub, but only the “Project page” type and only generated with GitHub actions.

1. Create the site.
2. Add a “.github/workflows/gh-pages.yml” as mentioned in the docs.
3. Add a “static/CNAME” file with the domain the site is going to use.
4. Push the code to a GitHub repo.
5. In the repo settings in the “Pages” section tell GitHub to serve pages from the root of the “gh-pages” branch (the action script will build and push that for you).
6. Add a CNAME record pointing to “\<USERNAME|ORGANIZATION\>.github.io.” in the DNS.

Now the site will deploy on each new push to the “main” branch.

Quick and easy!

I do this while on a call with the customer. Then I help them set up a [Forestry.io](http://Forestry.io) account and they can start add content to their new site before the call is over.

You can create the “gh-pages” branch with the generated content manually but that is a hassel. So mush easier to have GitHub action do it for you.

If you really want to generate the pages locally I would pick “docs” folder in “main” branch as the options in GitHub repo → Settings → “Pages”. Then you specify that Hugo should build the site in “docs” instead of “public”. I believe that should work but I have never tested it.

(The “User/Organisation” type pages seems only relevant if you plan to use `https://<USERNAME|ORGANIZATION>.github.io/` as the actual address of the site.)

---

_[View the full topic](https://discourse.gohugo.io/t/hosting-on-github-why-github-actions-needed/33250)._
