Skip to content

feat(deploy): add auto-rollback on health failure [Sprint 2.5 D3] #36

@Piboonsak

Description

@Piboonsak

Sprint 2.5 — D3: Auto-Rollback on Health Failure

Branch: feat/sprint-2.5-d3-auto-rollback
Base: main
Depends on: D1 ✅ (bkg-save.sh merged), D8 (manifest — can be done in parallel)

Task

Add auto-rollback to deploy and hotfix workflows when health check fails.

Files to create/modify in Piboonsak/openclaw_github:

  1. scripts/auto-rollback.sh (NEW)

    • Read bkg-latest.json symlink from /data/openclaw-config-archive/ to find last known good config
    • Restore that config to active config location on VPS
    • Recreate the Docker container with restored config
    • Run health check to verify recovery
    • Output clear rollback status (success or failure)
  2. .github/workflows/deploy-openclaw-github-private-secrets.yml (MODIFY)

    • On health check failure: call auto-rollback.sh via SSH
    • Report rollback status in workflow output
    • If rollback also fails: fail workflow with clear error message

Acceptance Criteria

  • Health check failure → auto-rollback to bkg-latest.json config
  • Auto-rollback recreates container + verifies health
  • Rollback status reported in workflow output
  • If rollback also fails: workflow fails with clear error message

Commit Message

feat(deploy): add auto-rollback on health failure (#202)

Reference

Labels

  • sprint-2.5
  • copilot

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions