From 51908ac14fd0414525dc1012e6f5ca10ad6bc715 Mon Sep 17 00:00:00 2001 From: Esdras Renan Date: Thu, 9 Oct 2025 18:02:26 -0300 Subject: [PATCH] ci(web): limpar .next antes do build para evitar EACCES de builds anteriores --- .github/workflows/ci-cd-web-desktop.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci-cd-web-desktop.yml b/.github/workflows/ci-cd-web-desktop.yml index c04b064..d14185b 100644 --- a/.github/workflows/ci-cd-web-desktop.yml +++ b/.github/workflows/ci-cd-web-desktop.yml @@ -147,6 +147,16 @@ jobs: cp -f "$DEFAULT_DIR/.env" "$EFFECTIVE_APP_DIR/.env" fi + - name: Clean Next.js cache (.next) to avoid EACCES + run: | + cd "$EFFECTIVE_APP_DIR" + if [ -e .next ]; then + echo "Removing existing .next (may be root-owned from previous container)" + rm -rf .next || (mv .next ".next.old.$(date +%s)" || true) + fi + mkdir -p .next + chmod -R u+rwX .next || true + - name: Install and build (Next.js) run: | cd "$EFFECTIVE_APP_DIR"