#!/bin/bash

# Deploy child theme CSS to production
echo "Deploying child theme CSS to production..."

# Create a tar archive of the CSS files
tar czf /tmp/child-theme-css.tar.gz -C astra-child-hvac css/

# Upload to server
scp /tmp/child-theme-css.tar.gz benr@146.190.76.204:/tmp/

# Extract on server
ssh benr@146.190.76.204 << 'EOF'
    cd /home/974670.cloudwaysapps.com/ncjzsayvsk/public_html/wp-content/themes/astra-child-hvac
    tar xzf /tmp/child-theme-css.tar.gz
    rm /tmp/child-theme-css.tar.gz
    echo "Child theme CSS deployed successfully"
    
    # Clear cache
    cd /home/974670.cloudwaysapps.com/ncjzsayvsk/public_html
    wp cache flush
EOF

# Clean up local temp file
rm /tmp/child-theme-css.tar.gz

echo "Deployment complete!"