ci: isolate build dirs per job (web.build.* vs convex.build.*) to avoid cross-job cleanup deleting live mounts

This commit is contained in:
Esdras Renan 2025-10-16 13:22:52 -03:00
parent 377ba39bac
commit 5dbe6986e6

View file

@ -63,7 +63,8 @@ jobs:
id: appdir id: appdir
run: | run: |
TS=$(date +%s) TS=$(date +%s)
FALLBACK_DIR="$HOME/apps/sistema.build.$TS" # Use a web-specific build dir to avoid clashes with convex job
FALLBACK_DIR="$HOME/apps/web.build.$TS"
mkdir -p "$FALLBACK_DIR" mkdir -p "$FALLBACK_DIR"
echo "Using APP_DIR (fallback)=$FALLBACK_DIR" echo "Using APP_DIR (fallback)=$FALLBACK_DIR"
echo "EFFECTIVE_APP_DIR=$FALLBACK_DIR" >> "$GITHUB_ENV" echo "EFFECTIVE_APP_DIR=$FALLBACK_DIR" >> "$GITHUB_ENV"
@ -239,8 +240,9 @@ jobs:
set -e set -e
ROOT="$HOME/apps" ROOT="$HOME/apps"
KEEP=2 KEEP=2
echo "Scanning $ROOT for old sistema.build.* dirs" PATTERN='web.build.*'
LIST=$(find "$ROOT" -maxdepth 1 -type d -name 'sistema.build.*' | sort -r || true) echo "Scanning $ROOT for old $PATTERN dirs"
LIST=$(find "$ROOT" -maxdepth 1 -type d -name "$PATTERN" | sort -r || true)
echo "$LIST" | sed -n "1,${KEEP}p" | sed 's/^/Keeping: /' || true echo "$LIST" | sed -n "1,${KEEP}p" | sed 's/^/Keeping: /' || true
echo "$LIST" | sed "1,${KEEP}d" | while read dir; do echo "$LIST" | sed "1,${KEEP}d" | while read dir; do
[ -z "$dir" ] && continue [ -z "$dir" ] && continue
@ -280,7 +282,8 @@ jobs:
id: appdir id: appdir
run: | run: |
TS=$(date +%s) TS=$(date +%s)
FALLBACK_DIR="$HOME/apps/sistema.build.$TS" # Use a convex-specific build dir to avoid clashes with web job
FALLBACK_DIR="$HOME/apps/convex.build.$TS"
mkdir -p "$FALLBACK_DIR" mkdir -p "$FALLBACK_DIR"
echo "Using APP_DIR (fallback)=$FALLBACK_DIR" echo "Using APP_DIR (fallback)=$FALLBACK_DIR"
echo "EFFECTIVE_APP_DIR=$FALLBACK_DIR" >> "$GITHUB_ENV" echo "EFFECTIVE_APP_DIR=$FALLBACK_DIR" >> "$GITHUB_ENV"
@ -366,7 +369,8 @@ jobs:
set -e set -e
ROOT="$HOME/apps" ROOT="$HOME/apps"
KEEP=2 KEEP=2
LIST=$(find "$ROOT" -maxdepth 1 -type d -name 'sistema.build.*' | sort -r || true) PATTERN='convex.build.*'
LIST=$(find "$ROOT" -maxdepth 1 -type d -name "$PATTERN" | sort -r || true)
echo "$LIST" | sed -n "1,${KEEP}p" | sed 's/^/Keeping: /' || true echo "$LIST" | sed -n "1,${KEEP}p" | sed 's/^/Keeping: /' || true
echo "$LIST" | sed "1,${KEEP}d" | while read dir; do echo "$LIST" | sed "1,${KEEP}d" | while read dir; do
[ -z "$dir" ] && continue [ -z "$dir" ] && continue