#!/bin/bash

# Variables
SOURCE_DIR="./public"
DEST_USER="demian"                # replace with your SSH username
DEST_HOST="pyte.dev"
DEST_DIR="/opt/docker/website/"
SSH_KEY="/home/demian/.ssh/id_ed25519-privat"              # replace with your private key path if different

# Copy folder using scp with SSH key
scp -i "$SSH_KEY" -r "$SOURCE_DIR" "$DEST_USER@$DEST_HOST:$DEST_DIR"

# Optional: print status
if [ $? -eq 0 ]; then
    echo "Folder '$SOURCE_DIR' successfully copied to $DEST_HOST:$DEST_DIR"
else
    echo "Error copying folder. Check your SSH key and connection."
fi
