Skip to content

Fix GitHub Pages deployment workflow for Hugo documentation site#186

Merged
7sharp9 merged 3 commits intomasterfrom
copilot/fix-9e1c27c5-b6d0-493b-b78d-51e553ca6f1e
Sep 26, 2025
Merged

Fix GitHub Pages deployment workflow for Hugo documentation site#186
7sharp9 merged 3 commits intomasterfrom
copilot/fix-9e1c27c5-b6d0-493b-b78d-51e553ca6f1e

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 26, 2025

Fixes the broken GitHub Pages deployment workflow that was preventing the Hugo documentation site from building and publishing correctly.

Issues Fixed

The existing gh-pages.yml workflow had several critical issues:

  1. Broken submodule initialization: The Hugo theme hugo-theme-relearn wasn't being loaded because the workflow used fetch-depth: 1 which is insufficient for submodules, and submodules: true instead of the more robust submodules: recursive.

  2. Outdated GitHub Actions: Used deprecated actions/checkout@v2 and obsolete ubuntu-20.04 runner which could cause compatibility issues.

  3. Missing manual deployment option: No way to trigger deployments on-demand without making commits.

  4. Insufficient permissions: Missing required GitHub Pages permissions for modern deployment workflows.

Changes Made

  • Updated GitHub Actions: Upgraded to actions/checkout@v4 and ubuntu-latest runner
  • Fixed submodule handling: Changed to submodules: recursive with fetch-depth: 0 to ensure the Hugo theme loads properly
  • Added manual deployment: Included workflow_dispatch trigger for on-demand deployments
  • Added required permissions: Specified pages: write and id-token: write permissions for GitHub Pages deployment
  • Cleaned up build artifacts: Updated .gitignore to exclude Hugo's .hugo_build.lock file

Testing

Verified the fix by:

  • Successfully building the Hugo site locally (generates 26 pages)
  • Confirming the hugo-theme-relearn theme loads correctly from the submodule
  • Testing both minified and regular builds work as expected

The workflow now supports both automatic deployment on commits to docs/ and manual deployment via the GitHub Actions interface.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • canonical-lgw01.cdn.snapcraftcontent.com
    • Triggering command: /usr/lib/snapd/snapd (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

On gh-pages.yml, can you gey my github pages deploymeny working? It uses hugo but i cant seem tofigure out how to ge tit to pucblish/update, it should not be dependent ona build as its just docs, it should be runnable with a commit on on demand


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@7sharp9 7sharp9 changed the title [WIP] can you gey my github pages deploymeny working? It uses hugo but i cant seem tofigure out how to ge tit to pucblish/update, it should not be dependent ona build as its just docs, it should be runnable with a commit on on demand [WIP] can you gey my github pages deploymeny working? It uses hugo but i cant seem tofigure out how to get it to publish/update, it should not be dependent on a build as its just docs, it should be runnable with a commit on on demand Sep 26, 2025
Copilot AI and others added 2 commits September 26, 2025 10:42
Co-authored-by: 7sharp9 <588746+7sharp9@users.noreply.github.com>
Co-authored-by: 7sharp9 <588746+7sharp9@users.noreply.github.com>
Copilot AI changed the title [WIP] can you gey my github pages deploymeny working? It uses hugo but i cant seem tofigure out how to get it to publish/update, it should not be dependent on a build as its just docs, it should be runnable with a commit on on demand Fix GitHub Pages deployment workflow for Hugo documentation site Sep 26, 2025
Copilot AI requested a review from 7sharp9 September 26, 2025 10:44
@7sharp9 7sharp9 marked this pull request as ready for review September 26, 2025 10:45
@7sharp9 7sharp9 merged commit 64d4681 into master Sep 26, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants