diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9f87495..ad694d4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -47,5 +47,10 @@ jobs: ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no "$VPS_USERNAME@$VPS_HOST" " cd /opt/imphenbot || exit echo \"$ENV_FILE\" > .env - docker-compose up -d --build + # Build and restart containers using available docker compose command + if command -v docker-compose &> /dev/null; then + docker-compose up -d --build + else + docker compose up -d --build + fi " diff --git a/deploy.sh b/deploy.sh index 35af15e..33676ec 100755 --- a/deploy.sh +++ b/deploy.sh @@ -39,7 +39,11 @@ fi echo "🔄 Rebuilding and restarting Docker containers..." $SSH_CMD << EOF cd $REMOTE_DIR - docker-compose up -d --build + if command -v docker-compose &> /dev/null; then + docker-compose up -d --build + else + docker compose up -d --build + fi EOF echo "✅ Deployment complete!"