Harden production deployment workflow

This commit is contained in:
Codex
2026-04-28 01:09:17 +08:00
parent c8ccaa9925
commit 46a72f815e
23 changed files with 243 additions and 21 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ async function getContactUsPageData(locale: Locale) {
return payload.findGlobal({
depth: 1,
locale,
slug: 'contactUsPage' as any,
slug: 'contactUsPage',
})
}
@@ -341,7 +341,7 @@ async function getDownloadsPageSettings(locale: Locale): Promise<DownloadsPageSe
return (await payload.findGlobal({
depth: 1,
locale,
slug: 'downloadsPage' as any,
slug: 'downloadsPage',
})) as DownloadsPageSettings
}
+1 -1
View File
@@ -2,7 +2,7 @@ import type { Metadata } from 'next'
import { NextIntlClientProvider } from 'next-intl'
import { getMessages, setRequestLocale } from 'next-intl/server'
import { notFound } from 'next/navigation'
import { isLocale, locales } from '@/i18n/config'
import { isLocale } from '@/i18n/config'
import { CookieConsent } from '@/components/site/cookie-consent'
import { ScrollToTop } from '@/components/site/scroll-to-top'
import { SiteHeader } from '@/components/site/site-header'
@@ -15,7 +15,7 @@ import { ProductContentTabs } from './product-content-tabs'
import { ProductGallerySection } from './product-gallery-section'
import { ProductTemplateMount } from './product-template-mount'
import { ProductVideosSection } from './product-videos-section'
import type { Media, News, NewsCategory, Product, ProductCategory, ProductReview, ProductVideo } from '@/payload-types'
import type { Media, News, NewsCategory, Product, ProductCategory, ProductReview } from '@/payload-types'
export const revalidate = 300
@@ -191,7 +191,7 @@ export default async function ProductsPage({
const payload = await getPayloadClient()
const page = await payload.findGlobal({
depth: 1,
slug: 'productsPage' as any,
slug: 'productsPage',
locale,
})
const categories = await payload.find({
+35
View File
@@ -0,0 +1,35 @@
import { NextResponse } from 'next/server'
import { getPayloadClient } from '@/lib/payload'
export const runtime = 'nodejs'
export const dynamic = 'force-dynamic'
export async function GET() {
try {
const payload = await getPayloadClient()
await payload.find({
collection: 'products',
depth: 0,
limit: 1,
pagination: false,
})
return NextResponse.json({
ok: true,
service: 'eversoloweb',
database: 'ok',
timestamp: new Date().toISOString(),
})
} catch (error) {
return NextResponse.json(
{
ok: false,
service: 'eversoloweb',
database: 'error',
error: error instanceof Error ? error.message : 'Unknown health check failure',
timestamp: new Date().toISOString(),
},
{ status: 503 },
)
}
}