ci: deploy main to the box from woodpecker #1
Loading…
Reference in a new issue
No description provided.
Delete branch "runa/hass:ci/deploy-from-main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Deploys main to the box from Woodpecker, so the config that runs is the config on main.
What's in it
.woodpecker/check.yml: HA's owncheck_config --fail-on-warningson every push and PR, inhome-assistant:2026.10.0(what the box runs). No secrets needed, so it works for fork PRs.just check-localruns the same check..woodpecker/deploy.yml: on push to main, after the check passes, runsscripts/sync-box.just deployruns the same script.scripts/sync-box:.deployed-rev, or a commit that doesn't descend from the deployed one;ha core checkwith the real secrets, and restores the last good tree if the box rejects the change;sensors/,helpers/utility_meter.yamlandconfiguration.yaml, and reloads for everything else.secrets.yamlstays on the box;just push-secretsfrom nikki is still the manual way to change it.Tested
check-configagainst current main: passes. Invalid platform entries and bad YAML both fail it. Without--fail-on-warnings, the invalid platform entry passed with exit 0.sync-boxagainst a local fake box (fake ssh,haandcurl): first deploy, forced baseline, reload vs restart, drift, rejection by the box with restore, version mismatch, re-run of an old build, dirty tree, lock held.woodpecker-cli lintfor v3.16.0.Before merging (yours)
hass_ssh_key, limited to the push event.meatbag/hassin Woodpecker..woodpecker/known_hostsagainst the box:ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pubshould printSHA256:yHrav+Yyo7D2P2Vwo3jkjV11+JTWtDhud6Qzk/fMqC4.just diff-box, thenFORCE=1 just deploy. The box has no.deployed-revyet, so the first CI deploy would refuse.Things to know
hass_ssh_key, so keep direct pushes to yourself.check.ymlis bumped. This is deliberate.SUPERVISOR_TOKENin the session, and thatcurlis installed there. If the first reload fails, that's where to look.themes/exists only on the box (configuration.yaml includes it) and isn't versioned.