An automated maintenance bot for Hugo websites.
It handles:
- Updating Hugo modules
- Taking screenshots (before/after)
- Comparing screenshots
- Creating Pull Requests with visual diffs
- Merging automatically if there are no visual differences
- Creating content markdown page (for your maintenance report website)
- Sending notifications (Discord, Slack, email...)
npm install @sebousan/hugo-maintenance-bot
# or
yarn add @sebousan/hugo-maintenance-bot# Process all sites in the datas directory
npx hugo-maintenance
# Process all sites in a specific folder : datas/folder
npx hugo-maintenance folder
# Process a specific site : datas/folder/website.yaml
npx hugo-maintenance websiteThe bot expects a datas/ directory in the current working directory containing site configurations in YAML format.
Example site config (datas/folder/website.yaml):
title: My Site
name: mysite
repository:
branch: main
provider: github
repo: username/repo
website:
url: https://www.mysite.com
pages:
- /
- /contact/
screenshots:
- mobile
- tablet
- laptop| Variable | Required | Description |
|---|---|---|
GH_TOKEN |
✅ | GitHub Personal Access Token (PR creation, branch management) |
GIT_USER_EMAIL |
✅ | Git user email for commits |
GIT_USER_NAME |
✅ | Git user name for commits |
Notifications are sent at the end of each site processing. A channel is automatically activated when its environment variable is set — no configuration needed.
| Channel | Environment variable | Status |
|---|---|---|
| Discord | DISCORD_WEBHOOK_URL |
✅ Available |
| Slack | SLACK_WEBHOOK_URL |
✅ Available |
SMTP_HOST |
Coming soon |
To get a Discord webhook URL: go to your Discord server settings → Integrations → Webhooks → New Webhook.
You can automate the maintenance using GitHub Actions. An example workflow is provided in examples/github-action.yml.
This workflow:
- Runs on a schedule (e.g., every 2 months)
- Sets up Node.js and Hugo
- Installs dependencies and Playwright browsers
- Runs the maintenance script for your websites
