feat(deploy): indexability guard and production SEO launch suite (MITHOME-127)
The staging noindex (MITHOME-116) hinges on a build variable; leaking it into production would silently drop the site from Google. deploy.sh now refuses to build production when NEXT_PUBLIC_DEPLOY_ENV=staging is set, and after every deploy runs scripts/check-indexability.sh, expecting an indexable production and a blocked staging (node tests cover both ways, stray noindex and unreachable endpoints; added to pre-deploy tests). A separate Playwright project, production-seo (npm run test:seo:production), checks robots.txt, that all 12 sitemap URLs are final/indexable with self canonicals and sitemap hreflangs, SSR content and links, the / -> /hu redirect and real 404s; host redirects are gated until the production domain is live. Verified on a production-mode build of a staging DB copy (5 passed) and failing as expected against staging. eslint now ignores generated test output (playwright-report, test-results, coverage), which broke the pre-deploy lint after local e2e runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
104756db7f
commit
dc7a777d9f
@@ -49,6 +49,16 @@ env_value() {
|
||||
}
|
||||
APP_PORT_VALUE="$(env_value APP_PORT)"
|
||||
|
||||
# 2b. Indexelhetőségi őr — build ELŐTT (MITHOME-127)
|
||||
# WHY: a NEXT_PUBLIC_DEPLOY_ENV=staging build-változó noindex-et és mindent
|
||||
# tiltó robots.txt-t süt az image-be (MITHOME-116). Productionben ez csendben
|
||||
# kivenné az oldalt a Google-találatok közül, ezért ott meg sem építjük.
|
||||
if [ "$ENV" = "production" ] && grep -hsE '^[[:space:]-]*NEXT_PUBLIC_DEPLOY_ENV[=:][[:space:]]*"?staging' "$ENV_FILE" "$COMPOSE_FILE" > /dev/null; then
|
||||
echo "❌ Hiba: productionben NEXT_PUBLIC_DEPLOY_ENV=staging van beállítva ($ENV_FILE vagy $COMPOSE_FILE)."
|
||||
echo " Ez noindexelné az éles oldalt. Töröld a beállítást, és futtasd újra a deployt."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 3. Docker konténerek újraépítése és indítása
|
||||
echo "🐳 Build és indítás..."
|
||||
# A friss Dockerfile- vagy build-arg-változásoknak is új konténerben kell érvényesülniük.
|
||||
@@ -73,6 +83,20 @@ if [ "$HEALTHY" -ne 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 4b. Indexelhetőség ellenőrzése — deploy UTÁN (MITHOME-127)
|
||||
# Production: indexelhető kell legyen; staging: tiltott (MITHOME-116).
|
||||
EXPECTED_INDEXING="blocked"
|
||||
if [ "$ENV" = "production" ]; then
|
||||
EXPECTED_INDEXING="indexable"
|
||||
fi
|
||||
if ! ./scripts/check-indexability.sh "http://localhost:${APP_PORT_VALUE:-$DEFAULT_PORT}" "$EXPECTED_INDEXING"; then
|
||||
echo "❌ Az indexelhetőség nem az elvárt ($EXPECTED_INDEXING) — a deploy HIBÁS."
|
||||
if [ "$ENV" = "production" ]; then
|
||||
echo " Az éles oldal most keresőkből kizárt állapotban fut: állítsd vissza az előző kiadást (lásd .agent/workflows/deploy.md → Rollback)."
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 5. Payload admin felhasználó biztosítása (MITHOME-97 follow-up)
|
||||
#
|
||||
# WHY: minden friss adatbázisú deploy (első staging/prod indítás, vagy egy
|
||||
|
||||
Reference in New Issue
Block a user