This commit is contained in:
1 parent
4e58da9a7a
commit
7eca691534
1 file changed
+11
-11
@@ -53,27 +53,27 @@ jobs:
|
||||
# 5. Build
|
||||
pnpm build
|
||||
|
||||
# 6. Sync Standalone Bundle & Overlays
|
||||
# 6. Sync Standalone Bundle (Symlink-only methode)
|
||||
echo "Preparing standalone bundle paths..."
|
||||
|
||||
# Zorg voor een schone basis
|
||||
# Maak mapstructuur
|
||||
mkdir -p .next/standalone/public
|
||||
cp -r public/* .next/standalone/public/ 2>/dev/null || true
|
||||
|
||||
# Kopieer alleen statische code en build-output
|
||||
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
|
||||
|
||||
# AANPASSING: Overlay dynamische assets (logo's/favicons) vanuit de veilige bron
|
||||
# --delete zorgt ervoor dat oude logo's die je uit de bronmap hebt verwijderd,
|
||||
# ook echt van de website verdwijnen.
|
||||
if [ -d /var/www/atom-media/public_assets ]; then
|
||||
rsync -av --delete /var/www/atom-media/public_assets/ .next/standalone/public/
|
||||
fi
|
||||
# Kopieer statische bestanden uit je repo (favicon etc), maar niet de mappen die we gaan linken
|
||||
cp -rn public/* .next/standalone/public/ 2>/dev/null || true
|
||||
|
||||
# Symlinks voor uploads (altijd verwijzen naar de veilige bron)
|
||||
rm -rf .next/standalone/public/uploads .next/standalone/public/imaging
|
||||
# Verwijder lokale mappen als ze per ongeluk door cp zijn aangemaakt
|
||||
rm -rf .next/standalone/public/uploads .next/standalone/public/imaging .next/standalone/public/public_assets
|
||||
|
||||
# Leg de symlinks naar de veilige opslagplek (dit wordt NOOIT gewist door de build)
|
||||
ln -sfn /var/www/atom-media/uploads .next/standalone/public/uploads
|
||||
ln -sfn /var/www/atom-media/imaging .next/standalone/public/imaging
|
||||
ln -sfn /var/www/atom-media/public_assets .next/standalone/public/public_assets
|
||||
|
||||
# 7. Permissions
|
||||
sudo chown -R www-data:www-data /var/www/atom-nexst/
|
||||
|
||||
Reference in new issue
Block a user