This commit is contained in:
1 parent
c73f41dc70
commit
60515393f5
1 file changed
+11
-4
@@ -37,28 +37,35 @@ jobs:
|
||||
# Verwijder oude builds, behoud de cache voor snelheid
|
||||
find .next -mindepth 1 -maxdepth 1 ! -name 'cache' -exec rm -rf {} + 2>/dev/null || true
|
||||
|
||||
# 3. Dependencies & Database
|
||||
# 3. Environment Sanitization
|
||||
# Zorgt ervoor dat gecachte omgevingsvariabelen met 'connect_timeout' de mysql2 driver niet storen
|
||||
if [ -f .env ]; then
|
||||
export $(grep -v '^#' .env | xargs)
|
||||
export DATABASE_URL=$(echo "$DATABASE_URL" | sed 's/[&?]connect_timeout=[^&]*//g')
|
||||
fi
|
||||
|
||||
# 4. Dependencies & Database
|
||||
export PNPM_CONFIG_ONLY_BUILT_DEPENDENCIES="@parcel/watcher,@swc/core,sharp"
|
||||
export PRISMA_SKIP_POSTINSTALL_GENERATE=1
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm db:migrate
|
||||
pnpm prisma:generate
|
||||
|
||||
# 4. Standalone Next.js Build
|
||||
# 5. Standalone Next.js Build
|
||||
export NEXT_DISABLE_SOURCEMAPS=1
|
||||
export NEXT_TELEMETRY_DISABLED=1
|
||||
export UV_THREADPOOL_SIZE=2
|
||||
export SKIP_ENV_VALIDATION=true
|
||||
pnpm build
|
||||
|
||||
# 5. Sync Standalone Bundle
|
||||
# 6. Sync Standalone Bundle
|
||||
echo "Preparing standalone bundle paths..."
|
||||
cp -r public .next/standalone/
|
||||
cp -r .next/static .next/standalone/.next/
|
||||
cp -r node_modules/@prisma .next/standalone/node_modules/ 2>/dev/null || true
|
||||
cp .env .next/standalone/.env
|
||||
|
||||
# 6. Permissions & Restart
|
||||
# 7. Permissions & Restart
|
||||
sudo chown -R www-data:www-data /var/www/atom-nexst/
|
||||
sudo chmod -R g+rw /var/www/atom-nexst/
|
||||
|
||||
|
||||
Reference in new issue
Block a user