Build an Auto-Updating Personal Static Website with Hugo + GitHub Actions
Build an Auto-Updating Personal Static Website with Hugo + GitHub Actions¶
Inspired by this article, I was introduced to Hugo and GitHub Pages. I’ve always wanted to build a personal website — not just a blog, but one that updates itself regularly with data I collect or subscribe to. This post documents how I combined Cursor, Hugo, GitHub Actions, and GitHub Pages to build an auto-updating personal website.
Project Goal¶
Create a clean, Hugo-based personal website and use GitHub Actions as a scheduling engine (similar to Linux crontab) to regularly run Python scripts for data crawling or dynamic updates. Then, automatically push the new content to GitHub Pages for instant deployment.
🛠 Development Workflow¶
Step 1: Develop with Cursor and Hugo¶
The entire development process was done using Cursor, an AI-enhanced IDE (like VSCode, but with ChatGPT built-in), making development and theme editing much easier.
I used Hugo to initialize the website, then fetched a theme using simple prompt-based commands, modified the layout and content to fit my needs, and tested the site locally.
Step 2: Deploy via GitHub Pages¶
After setting up the Hugo theme and structure, I hosted the site using GitHub Pages.
🔁 Making Static Sites Auto-Update¶
Since Hugo generates static pages, it can’t update dynamically on its own. I wanted some sections to update regularly — like data fetched from subscriptions, analytics, or newsletters.
So here’s how I approached it:
- Create a private repository where Python scripts pull and format the dynamic content.
- Use GitHub Actions (with cron syntax) to run those scripts on a schedule (e.g., daily).
- The script generates updated markdown files or JSON content and commits it to my public website repo (username.github.io).
- Once pushed, GitHub Pages automatically deploys the updated site.
This setup achieves “automated updates for a static site”.
I learned a lot from this comprehensive GitHub Actions tutorial: 🔗 https://dev.zhgchg.li/ci-cd-實戰指南-二-github-actions-與-self-hosted-runner-使用與建置大全-404bd5c70040
🧱 Architecture Overview¶
- Cursor: Develop and customize Hugo content with AI help
- Hugo: Generate the site and manage markdown/blog files
- GitHub Pages: Host the site statically
- GitHub Actions: Automate content generation + deployment
- Python: Fetch and format external content (optional)
📝 Final Thoughts¶
Although the concept is simple, this project integrates static site generation, dynamic updates, scheduled automation, and CI/CD concepts. It taught me how to use GitHub Actions not just for deployment, but also as a programmable cron server.
The current setup is basic, but I’m planning to:
- Add a comment system (e.g., Disqus or Giscus)
- Track update results and logs from GitHub Actions
- Add API or data visualization features
🙏 Thanks¶
Special thanks to the following articles that helped shape this project:
- From Medium to GitHub — by kucw
- CI/CD + GitHub Actions Guide — by zhgchg
If you found this article helpful, feel free to fork the repo or share your own ideas with me! 💬 GitHub: @1daniel3333 Medium: @p123456dan.mse99
Comments
Loading comments…
Leave a Comment