This guide explains how to deploy your Hugo site to GitHub Pages.
The repository includes a GitHub Actions workflow (.github/workflows/deploy.yml
) that automatically:
main
branch or manual dispatchmain
.\build.ps1
./build.sh
# Clean build
rm -rf public/
# Build for production
hugo --gc --minify --baseURL "https://seheheiden.github.io/"
# The site will be in the public/ directory
Note: Manual deployment is not recommended. The automated GitHub Actions workflow is preferred.
If you need to deploy manually for testing:
main
branch├── .github/workflows/deploy.yml # GitHub Actions workflow
├── content/ # Markdown content
├── static/ # Static assets
├── layouts/ # Hugo layouts
├── assets/ # Source assets
├── hugo.toml # Hugo configuration
└── themes/ # Hugo themes
├── public/ # Generated site (deployed)
├── resources/ # Hugo resources cache
└── .hugo_build.lock # Hugo build lock
hugo.toml
)The site is configured for GitHub Pages with:
https://seheheiden.github.io/
--gc
: Garbage collection for unused files--minify
: Minifies HTML, CSS, and JS--baseURL
: Sets the correct base URL for deploymentstatic/
directoryhugo --gc --minify --verbose --debug
hugo server --buildDrafts --buildFuture
hugo server
main
branchhttps://seheheiden.github.io/
The deployment typically takes 1-3 minutes to complete.
You can monitor the build status in the Actions tab of your GitHub repository. Each deployment will show: