Refactor deployment script for cloud-pc to remove unnecessary SSH command and streamline stack deployment process

This commit is contained in:
Dmitry
2026-05-27 15:47:24 +03:00
parent dc3ff78d6d
commit 9b361aa169
+1 -2
View File
@@ -14,12 +14,12 @@ jobs:
fetch-depth: 2 fetch-depth: 2
- name: Deploy changed stacks - name: Deploy changed stacks
run: | run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.CLOUD-PC_USER }}@${{ secrets.CLOUD-PC_HOST }} << 'ENDSSH'
cd /opt/services cd /opt/services
git pull git pull
for dir in $(git diff --name-only HEAD~1 HEAD | grep '^cloud-pc/' | cut -d/ -f2 | sort -u); do for dir in $(git diff --name-only HEAD~1 HEAD | grep '^cloud-pc/' | cut -d/ -f2 | sort -u); do
echo "==> Deploying $dir" echo "==> Deploying $dir"
cd /opt/services/cloud-pc/$dir cd /opt/services/cloud-pc/$dir
test -f docker-compose.yml || { echo "No docker-compose.yml in $dir, skipping"; cd /opt/services; continue; }
if grep -qE '^[[:space:]]*build:' docker-compose.yml; then if grep -qE '^[[:space:]]*build:' docker-compose.yml; then
docker compose up -d --build --remove-orphans docker compose up -d --build --remove-orphans
else else
@@ -28,4 +28,3 @@ jobs:
fi fi
cd /opt/services cd /opt/services
done done
ENDSSH