openclaw-dashboard-auto-deploy.md
/home/ubuntu/.openclaw/workspace/docs/openclaw-dashboard-auto-deploy.md
OpenClaw Dashboard: Auto-deploy (poll origin/main) via systemd timer
⚠️ Status: This mechanism is deprecated and currently disabled on the EC2 host.
The dashboard now uses GitHub Actions → SSH deploy → systemd restart (see openclaw-dashboard-deploy.md).
This doc is kept for historical reference in case we ever switch back.
This documents the simple “Option A” deployment mechanism for openclaw-dashboard on the EC2 host.
Goal
Automatically update the running dashboard when main changes in GitHub, without GitHub Actions / SSH deploy keys.
Approach: a systemd timer runs every ~5 minutes and executes a script that:
git fetch origin main- compares local
HEADvsorigin/main - if unchanged → exit (cheap)
- if changed →
git pull --ff-only - if
package.jsonorpackage-lock.jsonchanged →npm ci systemctl restart openclaw-dashboard.service
This keeps the dashboard updated with a bounded delay (≤ timer interval).
Components
Update script
- Path:
/usr/local/bin/openclaw-dashboard-update.sh - Repo:
/home/ubuntu/projects/openclaw-dashboard - Branch:
main - Service restarted:
openclaw-dashboard.service
Key behaviors:
- Uses fast-forward only pulls (
git pull --ff-only) to avoid accidental merge commits. - Runs
npm cionly when dependency files changed. - Restarts the dashboard service to apply updates.
systemd oneshot service
- Path:
/etc/systemd/system/openclaw-dashboard-update.service - Type:
oneshot - Runs as user:
ubuntu
systemd timer
- Path:
/etc/systemd/system/openclaw-dashboard-update.timer - Interval:
OnUnitActiveSec=5min - Jitter:
RandomizedDelaySec=20s - Persistent:
true(catches up after downtime)
Useful commands
See when it will run next
sudo systemctl status openclaw-dashboard-update.timer
sudo systemctl list-timers | grep openclaw-dashboard-update
Run an update immediately
sudo systemctl start openclaw-dashboard-update.service
View logs
sudo journalctl -u openclaw-dashboard-update.service --no-pager -n 200
Disable / re-enable
sudo systemctl disable --now openclaw-dashboard-update.timer
sudo systemctl enable --now openclaw-dashboard-update.timer
Notes / gotchas
- The update service restarts
openclaw-dashboard.service. That service currently runsnpm run buildon each restart viaExecStartPre, so updates trigger a rebuild automatically. - If you rename the repo remote or branch, update
/usr/local/bin/openclaw-dashboard-update.shaccordingly. - This mechanism deploys changes on
mainonly. For branch-based deploys, switch to a different branch or use a separate service/timer.