Introduction
As part of building my self-hosted Hugo publishing workflow, I wanted something simple:
- Edit content
- Commit changes
- Push to Git
- Deploy automatically
I didn’t want to manually SSH into the server every time.
So I wrote a small helper script called hillpush.
What hillpush Does
The script automates the full deployment workflow:
- Detects the Git repository root
- Checks for remote updates
- Rebases cleanly if required
- Stages and commits changes
- Pushes to Git
- Triggers the publish script on the web server
In short:
One command → Full deployment.
Example hillpush Script
Sensitive hostnames and usernames have been replaced with placeholders.
| |
The Server-Side Publish Script
On the web server, a separate script handles pulling and rebuilding the site:
| |
This ensures the server:
- Pulls the latest content
- Rebuilds the static site
- Syncs it to the web root
Why This Approach Works
- No external CI server required
- No manual SSH sessions
- Fully version-controlled deployments
- Clean separation between Git host and public web server
- Minimal firewall exposure (SSH only where required)
Final Thoughts
For a home lab or personal site, this strikes a great balance:
- Lightweight
- Secure
- Fully automated
- Easy to understand and maintain
Sometimes a small, well-designed script is all you need instead of a full enterprise CI/CD stack.
Comments