GitHub Template Project for Hugo with CD Action

Abhishek Sharma
SparseCode
Published in
2 min readJul 15, 2020

SparseCode started with the intent of sharing projects and code with fellow community members to learn and reuse the projects hassle-free. SparseCode is welcoming all types of projects which can be helpful for other fellow beings. Coding exercises of programming languages, data science projects, complex projects based on distributed programming whatever people want to share are welcome.

SparseCode is proudly sharing straightforward, however trendy builder base on Hugo for setting up a static website. It’s a GitHub template project name Hugo-template.

Hugo, GitHub Actions & GitHub Pages

Features of the Hugo-Template project

  • It’s a GitHub template project. The template project helps create a new repository with the same directory structure and files as the existing template repository. Anyone with reading permissions to a template repository can create a repository from that template. For more information on the template project, please follow the official link.
  • The project is useful for the creation of the static website and using GO programming based Hugo framework.

Hugo is one of the most popular open-source static site generators. With its incredible speed and flexibility. It’s written in Go (aka Golang) and easy to extend. Websites built with Hugo are speedy and secure. Hugo sites can be hosted anywhere, including Netlify, Heroku, GoDaddy, DreamHost, GitHub Pages, GitLab Pages, Surge, Aerobatic, Firebase, Google Cloud Storage, Amazon S3, Rackspace, Azure, and CloudFront and work well with CDNs. Hugo sites run without the need for a database or dependencies on expensive runtimes like Ruby, Python, or PHP.

  • The template consists of GitHub Actions to deploy the compiled code into the gh-pages branch. We can host the static website on GitHub using its pages features.

GitHub Actions automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you’d like, including CI/CD, and combine actions in a completely customized workflow.

In our case, we are using GitHub Actions to build recent changes to the branch of the repository and publish Hugo content to branch.

GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, optionally runs the files through a build process, and publishes a website.

  • For detailed documentation and the usage of the project, please follow another blog post.

Finally, SparseCode is very happy to share the project with the community. Enjoy and stay well!

References

Originally published at https://sparsecode.io.

--

--

Abhishek Sharma
SparseCode

Code Monkey 🐒, Data Architect, Streaming Solutions, Distributed Systems, Kubernetes & Coder at SparseCode.io, github.com/abhioncbr