Update .gitea/workflows/deploy.yaml
Local Build and Deploy / deploy (push) Successful in 54s

This commit is contained in:
remco committed 2026-07-18 15:57:25 +02:00
1 parent 60515393f5
commit dc90d6ec36
1 file changed
+18 -2
+18 -2
View File
@@ -24,6 +24,11 @@ jobs:
}
trap 'error_handler $LINENO' ERR
# Zorg dat de externe opslagmap bestaat met de juiste rechten
sudo mkdir -p /var/www/atom-media
sudo chown -R www-data:www-data /var/www/atom-media
sudo chmod -R 775 /var/www/atom-media
# 2. Cleanup & Git Sync
docker image prune -f
cd /var/www/atom-nexst/
@@ -32,13 +37,20 @@ jobs:
git fetch origin --prune
git reset --hard origin/main
git clean -fd -e .env -e .env.local -e .env.production -e .env*.local -e .next
# -e public/uploads zorgt dat git clean je media-link/map in de hoofdmap negeert
git clean -fd -e .env -e .env.local -e .env.production -e .env*.local -e .next -e public/uploads
# Zorg dat public/uploads in de hoofdmap altijd gekoppeld is
if [ ! -L public/uploads ]; then
rm -rf public/uploads
ln -s /var/www/atom-media public/uploads
fi
# Verwijder oude builds, behoud de cache voor snelheid
find .next -mindepth 1 -maxdepth 1 ! -name 'cache' -exec rm -rf {} + 2>/dev/null || true
# 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')
@@ -65,6 +77,10 @@ jobs:
cp -r node_modules/@prisma .next/standalone/node_modules/ 2>/dev/null || true
cp .env .next/standalone/.env
# Koppel de uploads symlink binnen de nieuwe standalone distributie
rm -rf .next/standalone/public/uploads
ln -s /var/www/atom-media .next/standalone/public/uploads
# 7. Permissions & Restart
sudo chown -R www-data:www-data /var/www/atom-nexst/
sudo chmod -R g+rw /var/www/atom-nexst/