chore(dev): Check env prior to Algolia indexing
This commit is contained in:
parent
8dbeb83cc9
commit
4b8fbbb580
1 changed files with 13 additions and 3 deletions
|
@ -141,9 +141,19 @@ const indexMarkdownContent = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const run = async () => {
|
const run = async () => {
|
||||||
|
if (
|
||||||
|
(process.env.NETLIFY && process.env.CONTEXT === 'production')
|
||||||
|
|| process.env.FORCE_ALGOLIA
|
||||||
|
) {
|
||||||
await indexMarkdownContent()
|
await indexMarkdownContent()
|
||||||
await indexStrapiContent()
|
await indexStrapiContent()
|
||||||
console.log()
|
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()
|
run()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue