A ready out-of-the-box project to build your website using Hugo with GitHub Pages and GitHub Actions as Continuous Delivery.
In a local environment provide a Docker isolation with Traefik routing
to avoid the ugly http://localhost:666/...
url and reproduce a more consistent environment between CD and local
development.
- Docker
- Docker Compose
- GNU Make (recommended, but not mandatory)
In few steps you can have a cool website!
-
Set values in .env
- HUGO_VERSION: The Hugo version which you will use. This really corresponds to Hugo Docker Image, check it out on its DockerHub.
- LOCAL_PORT: The local port of Hugo Server.
- LOCAL_DOMAIN: The local domain of Hugo Server. Must be ended with top domain
.localhost
! - EXTERNAL_DOMAIN: Your domain for hosted page. This value is used to create a
CNAME
file in your build. - GIT_DEPLOY_BRANCH: The output branch to host the website build for GitHub Pages. (
Repo > Settings > Pages
)
-
Add your selected theme in the project! See more
-
Fill and complete the
config.toml
file for your website. -
Check in the local environment your coolest website.
-
Enable the GitHub Pages in your repository and set the right DNS registers in your provider.
- Remember, the git branch must be the same that set in the
.env
file! - GitHub Pages Docs
- GitHub Pages Custom DNS
- Remember, the git branch must be the same that set in the
-
Cool! You're ready to publish your website!
- If you're working in a different branch that
main
, merge your changes inmain
branch to publish the website. - Push your changes to GitHub
git push origin main
- If you're working in a different branch that
Open the docker-compose.yml
file and check the value services.hugo.command
.
In the deploy-hugo.yml
file contains all descriptors. Check the official
documentation if you have any question.
Copyleft (ɔ) - Aran Moncusí Ramírez aran@digitalpoetinfo
This template is released under the GPL v3 License. Check it!