Skip to content

feat(deploy): add BKG save step to deploy workflow [Sprint 2.5 D1] #31

@Piboonsak

Description

@Piboonsak

Sprint 2.5 — D1: BKG Save Step — Deploy Workflow

Branch: feat/sprint-2.5-d1-bkg-deploy
Base: main
Depends on: D4 ✅ (feat/sprint-2.5-d4-schema-validation merged via PR #30)

Task

Add a Best-Known-Good (BKG) config save step to the deploy workflow.

Files to create/modify in Piboonsak/openclaw_github:

  1. scripts/bkg-save.sh (NEW)

    • Copy current running openclaw config from VPS to /data/openclaw-config-archive/
    • Name format: bkg-{YYYYMMDD-HHmmss}-{short-sha}.json
    • Update symlink: bkg-latest.json → newest healthy config
    • Rotate: keep max 10 entries, auto-delete oldest
    • Make executable: chmod +x scripts/bkg-save.sh
  2. .github/workflows/deploy-openclaw-github-private-secrets.yml (MODIFY)

    • Add BKG save step AFTER health check PASS step
    • Only run if health check succeeded (use if: success())
    • Call bkg-save.sh via SSH on VPS

Acceptance Criteria

  • AC-1: After successful deploy → BKG snapshot saved to /data/openclaw-config-archive/
  • AC-2: BKG file named bkg-{timestamp}-{sha}.json
  • AC-3: bkg-latest.json symlink updated to most recent healthy config
  • AC-4: Max 10 BKG entries, oldest auto-rotated
  • AC-5: BKG save only triggers after health check PASS (not on failure)

Commit Message

feat(deploy): add BKG save step to deploy workflow (#202)

Reference

  • Master issue: Piboonsak/Openclaw#202
  • D4 (validate-config.sh) already in main — use as reference for script pattern
  • VPS config path: /data/.openclaw/openclaw.json (verify from existing workflow)

Labels

  • sprint-2.5
  • copilot

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions