fix: Use home directory instead of /opt for CT109 deployment (permission issue)
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 1s

This commit is contained in:
SysAdmin 2025-11-17 13:29:17 +00:00
parent d4c2bedf9b
commit 541b531290

View File

@ -191,16 +191,25 @@ jobs:
set -e
export VERSION="${{ github.sha }}"
# Navigate to deployment directory
cd /opt/littleshop || mkdir -p /opt/littleshop && cd /opt/littleshop
# Use home directory for deployment
DEPLOY_DIR="$HOME/littleshop"
echo "Using deployment directory: $DEPLOY_DIR"
# Create deployment directory if it doesn't exist
mkdir -p "$DEPLOY_DIR"
cd "$DEPLOY_DIR"
# Clone or pull latest code
if [ ! -d .git ]; then
echo "Cloning repository..."
rm -rf * # Clean any existing files
git clone https://git.silverlabs.uk/Jamie/littleshop.git .
fi
echo "Pulling latest code from git..."
else
echo "Repository already cloned, pulling latest..."
git fetch origin
fi
echo "Checking out version: $VERSION"
git checkout $VERSION || git checkout main
# Build images on CT109