feat(update-frontend): enhance environment file handling and add Google AdSense script
All checks were successful
Deploy to production / deploy (push) Successful in 2m3s
All checks were successful
Deploy to production / deploy (push) Successful in 2m3s
- Updated the script to prioritize the root environment file for builds, falling back to the frontend environment file if necessary. - Added a Google AdSense script to the frontend HTML for improved monetization capabilities.
This commit is contained in:
@@ -32,6 +32,10 @@
|
|||||||
<link rel="alternate" hreflang="fr" href="%VITE_PUBLIC_BASE_URL%/?lang=fr" />
|
<link rel="alternate" hreflang="fr" href="%VITE_PUBLIC_BASE_URL%/?lang=fr" />
|
||||||
<link rel="alternate" hreflang="x-default" href="%VITE_PUBLIC_BASE_URL%/" />
|
<link rel="alternate" hreflang="x-default" href="%VITE_PUBLIC_BASE_URL%/" />
|
||||||
|
|
||||||
|
<!-- Google AdSense (Auto ads) -->
|
||||||
|
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1104166651501135"
|
||||||
|
crossorigin="anonymous"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ TARGET_DIR="${1:?target dir required}"
|
|||||||
FRONTEND_DIR="$TARGET_DIR/frontend"
|
FRONTEND_DIR="$TARGET_DIR/frontend"
|
||||||
CURRENT_LINK="/opt/yourpart"
|
CURRENT_LINK="/opt/yourpart"
|
||||||
CURRENT_FRONTEND="$CURRENT_LINK/frontend"
|
CURRENT_FRONTEND="$CURRENT_LINK/frontend"
|
||||||
|
CURRENT_ROOT_ENV="$CURRENT_LINK/.env"
|
||||||
|
|
||||||
echo "=== YourPart Frontend Update ==="
|
echo "=== YourPart Frontend Update ==="
|
||||||
echo "Ziel: $FRONTEND_DIR"
|
echo "Ziel: $FRONTEND_DIR"
|
||||||
@@ -25,8 +26,12 @@ rm -rf node_modules/.cache/
|
|||||||
|
|
||||||
TEMP_ENV="/tmp/yourpart-frontend-env-$$"
|
TEMP_ENV="/tmp/yourpart-frontend-env-$$"
|
||||||
|
|
||||||
if [ -f "$CURRENT_FRONTEND/.env" ]; then
|
if [ -f "$CURRENT_ROOT_ENV" ]; then
|
||||||
echo "Nutze bestehende .env-Datei vom Live-System für Build..."
|
echo "Nutze bestehende .env-Datei vom Live-System (Root) für Build..."
|
||||||
|
cp "$CURRENT_ROOT_ENV" "$TEMP_ENV"
|
||||||
|
cp "$TEMP_ENV" .env
|
||||||
|
elif [ -f "$CURRENT_FRONTEND/.env" ]; then
|
||||||
|
echo "Nutze bestehende .env-Datei vom Live-System (Frontend) für Build..."
|
||||||
cp "$CURRENT_FRONTEND/.env" "$TEMP_ENV"
|
cp "$CURRENT_FRONTEND/.env" "$TEMP_ENV"
|
||||||
cp "$TEMP_ENV" .env
|
cp "$TEMP_ENV" .env
|
||||||
elif [ -f .env.production ]; then
|
elif [ -f .env.production ]; then
|
||||||
@@ -68,4 +73,4 @@ if [ -f "$FRONTEND_DIR/.env" ]; then
|
|||||||
fi
|
fi
|
||||||
sudo -n chmod -R 755 "$FRONTEND_DIR/dist"
|
sudo -n chmod -R 755 "$FRONTEND_DIR/dist"
|
||||||
|
|
||||||
echo "=== Frontend Update abgeschlossen! ==="
|
echo "=== Frontend Update abgeschlossen! ==="
|
||||||
|
|||||||
Reference in New Issue
Block a user