diff --git a/.github/workflows/ci-cd-web-desktop.yml b/.github/workflows/ci-cd-web-desktop.yml index eb2d350..6494ffb 100644 --- a/.github/workflows/ci-cd-web-desktop.yml +++ b/.github/workflows/ci-cd-web-desktop.yml @@ -200,11 +200,18 @@ jobs: set -e DEST="$HOME/apps/sistema" mkdir -p "$DEST" + mkdir -p "$DEST/.next/static" # One-time fix for old root-owned files (esp. .pnpm-store) left by previous containers docker run --rm -v "$DEST":/target alpine:3 sh -lc 'chown -R 1000:1000 /target 2>/dev/null || true; chmod -R u+rwX /target 2>/dev/null || true' || true + # Preserve previously published static assets to keep stale chunks available for clients mid-navigation + if [ -d "$EFFECTIVE_APP_DIR/.next/static" ]; then + rsync -a \ + "$EFFECTIVE_APP_DIR/.next/static/" "$DEST/.next/static/" + fi # Publish new build; exclude .pnpm-store to avoid Permission denied on old entries rsync -a --delete \ --exclude '.pnpm-store' --exclude '.pnpm-store/**' \ + --exclude '.next/static' \ "$EFFECTIVE_APP_DIR"/ "$DEST"/ echo "Published build to: $DEST"