# Help with Github Pages setup

**URL:** <https://discourse.gohugo.io/t/help-with-github-pages-setup/32599>\
**Category:** support\
**Created:** [April 28, 2021, 8:18pm UTC](https://discourse.gohugo.io/t/help-with-github-pages-setup/32599 "2021-04-28T20:18:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradbice](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bradbice/32/14162_2.png) [@bradbice](https://discourse.gohugo.io/u/bradbice)\
**Post date:** [April 28, 2021, 8:18pm UTC](https://discourse.gohugo.io/t/help-with-github-pages-setup/32599/1 "2021-04-28T20:18:34Z")

</div>

I’m following the docs ([Host on GitHub | Hugo](https://gohugo.io/hosting-and-deployment/hosting-on-github/#build-hugo-with-github-action)) and using the Github Action ([Hugo setup · Actions · GitHub Marketplace · GitHub](https://github.com/marketplace/actions/hugo-setup)), however I’m missing a piece.

Github Pages is asking for a build folder of `/docs` to publish the site. But if I supply that, then the site is built from there and the Github Action of running the `hugo -b https://mydomain.com/` build command is not used.

If I don’t supply a `/docs` folder in my repository, then Github Pages errors out saying a docs folder is missing.

What am **I** missing here?

Here’s my `gh-pages.yml` file:

```auto
name: github pages

on:
  push:
    branches:
      - master # Set a branch to deploy

jobs:
  deploy:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true # Fetch Hugo themes (true OR recursive)
          fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2.4.13
        with:
          hugo-version: 'latest'
          extended: true

      - name: Build
        run: hugo -b https://myusername.github.io/sitename

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./docs

```

and in my `config.toml` I have:

```auto
baseURL = "/"
publishDir = "docs"

```

When the site is published, it is publishing directly from `/docs` without using the newly built site from the Github Action.

---

<div class="post-metadata">

**Author:** ![bradbice](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bradbice/32/14162_2.png) [@bradbice](https://discourse.gohugo.io/u/bradbice)\
**Post date:** [April 29, 2021, 4:52am UTC](https://discourse.gohugo.io/t/help-with-github-pages-setup/32599/2 "2021-04-29T04:52:15Z")

</div>

So I finally figured out that the Github Pages action will push the static site from `master/main` branch `/docs` folder, and commit that to the `gh-pages` branch. This is where Github Pages serves the site.

---

<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 1, 2021, 4:52am UTC](https://discourse.gohugo.io/t/help-with-github-pages-setup/32599/3 "2021-05-01T04:52:55Z")

</div>

Closed on May 1, 2021, 4:52am UTC

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