peaceiris/actions-hugo

support: Hugo not deploying to gh-pages branch

Xevion opened this issue · 3 comments

Checklist

  • I am using the latest version of this action.
  • I have read the latest README and followed the instructions.
  • I have read the latest GitHub Actions official documentation and learned the basic spec and concepts.

Describe your question

Why is my Hugo Deploy Action not deploying to my gh-pages branch correctly?

Relevant links

Public repository: https://github.com/Xevion/powershell/
TOML* config: https://github.com/Xevion/powershell/blob/7abb7a6bf5c5f58b46d8ef80514e2deda53d0ae6/config.toml
YAML workflow: https://github.com/Xevion/powershell/blob/7abb7a6bf5c5f58b46d8ef80514e2deda53d0ae6/.github/workflows/gh-pages.yml

Relevant log output

No relevant log output. Check latest action as of time of issue creation for details.

Additional context.

I have everything set up correctly to the best of my knowledge. The submodule for the theme exists, it runs on my local machine with the version provided correctly. I've read both the Actions repo README and the Hugo Actions repo's README several times. My action deploys without error. The repository is set to use the gh-pages branch as mentioned. I've tried using /docs and /<root>, and switched around the Workflow YML configuration several times, but nothing has worked. Currently, Jekyll's README deploys, so I'm not sure what to make of that.

I really do apologize if it's something obvious, but I've exhausted all ideas on how to get this working and Google won't give me any useful suggestions.

Thanks.

Apologies for opening up the issue. After leaving the issue alone and coming back to it later tonight, I was able to just now fix it.

  • First, the if: ${{ github.ref == 'refs/heads/master' }} was comparing against the main branch, so it would work successfully all the way until the deploy stage, but it wouldn't error, just silently exit instantly.
  • After fixing that, it didn't immediately work, but after coming back to the issue tonight, I noticed a commit had finally been made inside gh-pages, but it was empty.
  • After inspection, I found that hugo generates to the ./public directory. I'm not very experienced with hugo, so my knowledge of why ./public was the default folder was limited to believing it was perhaps an obsolete GitHub pages deployment folder (like /docs, or perhaps it was for organization repositories).
  • After figuring that out and reading more on the peaceiris/actions-gh-pages repo, I finally figured out that publish_dir was not the directory that the commit places files to be published from - it's what the action pulls from, explaining why the headline for publish_dir says "Source Directory".
  • With that, I changed it back, and things are now working.

I apologize if I wasted anyone time with this issue.

Thanks, great notes! Enjoy Hugo ʕ◔ϖ◔ʔ

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved.
If you still encounter this or it has changed, open a new issue instead of responding to solved ones.