Skip to content

Fix GitHub Pages deployment for Hugo - #5

Merged
besendorf merged 1 commit into
mainfrom
fix/pages-actions-deploy
Oct 5, 2026
Merged

besendorf merged 1 commit into
mainfrom
fix/pages-actions-deploy

Conversation

@besendorf

Copy link
Copy Markdown
Owner

What changed

  • Build the Hugo site in GitHub Actions and upload the generated public/ directory as a Pages artifact.
  • Deploy with GitHub's actions/deploy-pages workflow and the required pages: write and id-token: write permissions.
  • Keep pull requests build-only; deploy only from main, with a manual workflow_dispatch option.

Why

The existing workflow pushed output to gh-pages with GITHUB_TOKEN. GitHub documents that workflow commits made with GITHUB_TOKEN do not trigger a GitHub Pages build, which left the published site stale. This workflow uses the supported Pages artifact deployment path.

Required setting

Before deployment, set Settings → Pages → Build and deployment → Source to GitHub Actions.

@besendorf
besendorf merged commit dcf0f41 into main Oct 5, 2026
2 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.

1 participant