chore: move seeding to onInit and remove redundant seed script
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Successful in 2m15s
Build & Deploy / 🏗️ Build (push) Successful in 3m51s
Build & Deploy / 🚀 Deploy (push) Successful in 21s
Build & Deploy / 🧪 Smoke Test (push) Failing after 1m3s
Build & Deploy / ⚡ Lighthouse (push) Has been skipped
Build & Deploy / ♿ WCAG (push) Has been skipped
Build & Deploy / 🛡️ Quality Gates (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 9s

This commit is contained in:
2026-02-24 23:52:27 +01:00
parent c4fca24eca
commit 3dcde28071
5 changed files with 51 additions and 72 deletions

View File

@@ -21,11 +21,17 @@ import { Posts } from './src/payload/collections/Posts';
import { FormSubmissions } from './src/payload/collections/FormSubmissions';
import { Products } from './src/payload/collections/Products';
import { Pages } from './src/payload/collections/Pages';
import { seedDatabase } from './src/payload/seed';
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
export default buildConfig({
onInit: async (payload) => {
if (process.env.NODE_ENV === 'production') {
await seedDatabase(payload);
}
},
admin: {
user: Users.slug,
importMap: {