Skip to content

Commit 2b74faa

Browse files
committed
fix(ci): dynamically locate and copy .prisma directory to fix build error
1 parent 4ff5dd4 commit 2b74faa

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.github/workflows/cms_cms.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,13 @@ jobs:
5151
# Copy @next/env directly from pnpm store (wildcard for version toggle)
5252
cp -r node_modules/.pnpm/@next+env*/node_modules/@next/env .next/standalone/node_modules/@next/
5353
54-
# Manually copy generated Prisma client
55-
cp -r node_modules/.prisma .next/standalone/node_modules/
54+
# Manually copy generated Prisma client (dynamically locate it)
55+
PRISMA_DIR=$(find node_modules -type d -name ".prisma" | head -n 1)
56+
if [ -n "$PRISMA_DIR" ]; then
57+
cp -r "$PRISMA_DIR" .next/standalone/node_modules/
58+
else
59+
echo "WARNING: .prisma directory not found!"
60+
fi
5661
5762
mkdir deployment
5863
rsync -aL .next/standalone/ deployment/ || echo "Rsync: Some files could not be copied (likely broken symlinks)"

.github/workflows/main_cms.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,13 @@ jobs:
5252
# Copy @next/env directly from pnpm store (wildcard for version toggle)
5353
cp -r node_modules/.pnpm/@next+env*/node_modules/@next/env .next/standalone/node_modules/@next/
5454
55-
# Manually copy generated Prisma client
56-
cp -r node_modules/.prisma .next/standalone/node_modules/
55+
# Manually copy generated Prisma client (dynamically locate it)
56+
PRISMA_DIR=$(find node_modules -type d -name ".prisma" | head -n 1)
57+
if [ -n "$PRISMA_DIR" ]; then
58+
cp -r "$PRISMA_DIR" .next/standalone/node_modules/
59+
else
60+
echo "WARNING: .prisma directory not found!"
61+
fi
5762
5863
mkdir deployment
5964
rsync -aL .next/standalone/ deployment/ || echo "Rsync: Some files could not be copied (likely broken symlinks)"

0 commit comments

Comments
 (0)