diff --git a/.github/workflows/ci-cd-web-desktop.yml b/.github/workflows/ci-cd-web-desktop.yml index 6894276..84aaa73 100644 --- a/.github/workflows/ci-cd-web-desktop.yml +++ b/.github/workflows/ci-cd-web-desktop.yml @@ -236,7 +236,11 @@ jobs: - name: Cleanup old build workdirs (keep last 3) run: | - ls -1dt $HOME/apps/sistema.build.* 2>/dev/null | tail -n +4 | xargs -r rm -rf || true + set -e + find "$HOME/apps" -maxdepth 1 -type d -name 'sistema.build.*' | sort -r | tail -n +4 | while read dir; do + echo "Removing $dir" + sudo rm -rf "$dir" + done || true - name: Restart web service with new code run: |