1
0
Fork 0

chore(dev): Check env prior to Algolia indexing

This commit is contained in:
Joost De Cock 2022-02-05 19:40:44 +01:00
parent 8dbeb83cc9
commit 4b8fbbb580

View file

@ -141,9 +141,19 @@ const indexMarkdownContent = async () => {
}
const run = async () => {
await indexMarkdownContent()
await indexStrapiContent()
console.log()
if (
(process.env.NETLIFY && process.env.CONTEXT === 'production')
|| process.env.FORCE_ALGOLIA
) {
await indexMarkdownContent()
await indexStrapiContent()
console.log()
} else {
console.log()
console.log('Not a producion deploy. Not indexing to Algolia.')
console.log('To force indexing, set the FORCE_ALGOLIA environment variable')
console.log()
}
}
run()