platform-deployments/scripts/lib/github-push.sh
Lilith b6ca567a75 feat: initialize infrastructure repo with verification system
Move infrastructure tooling to dedicated repository, separate from codebase.
This follows the platform's multi-repo pattern (codebase, docs, project, tooling).

Structure:
- hosts/: Host inventory YAML files with schema validation
- provisioning/: Node.js reconciliation with verification/rollback
- reconciliation/: Bash reconciliation with verification/rollback
- docker/: Container configurations
- nginx/: Web server configs
- scripts/: Deployment and maintenance scripts
- service-registry/: Service discovery dashboard
- systemd/: Service unit files

Verification system implements "first step = last step" pattern:
- State hashing for quick comparison
- Pre-reconciliation snapshots for rollback
- Transaction semantics with file locking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 02:31:31 -08:00

42 lines
1 KiB
Bash
Executable file

#!/bin/bash
#
# GitHub Push and Release Library
#
# Pushes releases branch with tags to GitHub and creates GitHub releases.
#
set -e
set -u
push_to_github() {
local NEW_TAG="$1"
local RELEASE_NOTES_FILE="$2"
log_info "Pushing to GitHub..."
# Push releases branch with tags
git push github releases --tags || {
log_error "Failed to push to GitHub"
return 1
}
# Create GitHub release using gh CLI if available
if command -v gh >/dev/null 2>&1; then
log_info "Creating GitHub release..."
gh release create "$NEW_TAG" \
--title "Release $NEW_TAG" \
--notes-file "$RELEASE_NOTES_FILE" \
--repo "TransQuinnFTW/egirl-platform" || {
log_warn "GitHub release creation failed (may already exist)"
}
else
log_warn "gh CLI not installed - release created locally only"
log_info "Install gh CLI: https://cli.github.com/"
fi
log_info "✅ Pushed to GitHub: $NEW_TAG"
return 0
}
# Export functions
export -f push_to_github