HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux mail.btech-izolacje.pl 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
User: pewna6876 (1017)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //srv/rmgun_admin/admin-next/deploy.sh
#!/bin/bash

# Deploy script for rmgun_admin
# This script connects to the server and deploys the latest changes

set -e  # Exit on error

echo "🚀 Starting deployment to Hetzner server..."

# Connect to the Hetzner server and execute commands
ssh root@88.198.11.196 << 'ENDSSH'
    set -e  # Exit on error within SSH session

    echo "📂 Navigating to /srv/rmgun_admin..."
    cd /srv/rmgun_admin

    echo "🔄 Fetching latest changes from origin/main..."
    git fetch origin

    echo "🔨 Hard resetting to origin/main..."
    git reset --hard origin/main

    echo "📁 Entering admin-next directory..."
    cd admin-next

    echo "🏗️  Running make rebuild with production environment..."
    ENV=prod make rebuild

    echo "✅ Deployment completed successfully!"
ENDSSH

if [ $? -eq 0 ]; then
    echo "✅ Deployment finished successfully!"
else
    echo "❌ Deployment failed!"
    exit 1
fi