ci: retain previous next static assets during publish
This commit is contained in:
parent
38651ca706
commit
7718f77d4c
1 changed files with 7 additions and 0 deletions
7
.github/workflows/ci-cd-web-desktop.yml
vendored
7
.github/workflows/ci-cd-web-desktop.yml
vendored
|
|
@ -200,11 +200,18 @@ jobs:
|
||||||
set -e
|
set -e
|
||||||
DEST="$HOME/apps/sistema"
|
DEST="$HOME/apps/sistema"
|
||||||
mkdir -p "$DEST"
|
mkdir -p "$DEST"
|
||||||
|
mkdir -p "$DEST/.next/static"
|
||||||
# One-time fix for old root-owned files (esp. .pnpm-store) left by previous containers
|
# 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
|
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
|
# Publish new build; exclude .pnpm-store to avoid Permission denied on old entries
|
||||||
rsync -a --delete \
|
rsync -a --delete \
|
||||||
--exclude '.pnpm-store' --exclude '.pnpm-store/**' \
|
--exclude '.pnpm-store' --exclude '.pnpm-store/**' \
|
||||||
|
--exclude '.next/static' \
|
||||||
"$EFFECTIVE_APP_DIR"/ "$DEST"/
|
"$EFFECTIVE_APP_DIR"/ "$DEST"/
|
||||||
echo "Published build to: $DEST"
|
echo "Published build to: $DEST"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue