skillguard/hetzner-deployment/deploy-github-push.sh
Replit Agent 86e9fb57ab
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Set up automated deployment and configuration for SkillGuard
Configure deployment workflows, SSH settings, and environment variables for the SkillGuard project.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 0d01f99a-ea6a-447d-82fd-311715434a39
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: f938974b-4b4e-47df-8a70-53fbb1c1de6e
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/e32d2b99-1721-47dd-833c-98b372f48008/0d01f99a-ea6a-447d-82fd-311715434a39/b33cDqP
Replit-Helium-Checkpoint-Created: true
2026-06-18 15:57:14 +00:00

46 lines
1.2 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
# =============================================================================
# deploy-github-push.sh
# Pusht den aktuellen main-Branch an das Forgejo-Remote der Zielinstanz.
#
# Verwendung: ./deploy-github-push.sh <target>
# Beispiel: ./deploy-github-push.sh audit
# =============================================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# --- Kontext laden ---
source "${SCRIPT_DIR}/ssh_context.sh" "$@"
# --- SSH (Key wird geladen, Passphrase einmalig abgefragt) ---
setup_ssh
# --- Git-Push ---
echo ""
echo "=== Code-Deployment ==="
echo "Target: ${TARGET} (${DOMAIN})"
echo "Remote: ${GIT_REMOTE}"
echo ""
echo "Pruefe Git-Remote '${GIT_REMOTE}'..."
if ! git remote get-url "${GIT_REMOTE}" &>/dev/null; then
echo "FEHLER: Git-Remote '${GIT_REMOTE}' existiert nicht."
echo "Verfuegbare Remotes:"
git remote -v
exit 1
fi
echo "Starte Push: main -> ${GIT_REMOTE}..."
git push "${GIT_REMOTE}" main --force
PUSH_EXIT=$?
if [ $PUSH_EXIT -ne 0 ]; then
echo "FEHLER: Git-Push fehlgeschlagen (Exit-Code: ${PUSH_EXIT})."
exit 1
fi
echo ""
echo "=== Code-Deployment fuer '${TARGET}' abgeschlossen ==="