feat(docs): add revalidation api route (#29378)

Add a route for manually revalidating cache contents by tag.

The route is protected by authentication to prevent abuse. Automated
actions in CI should be set up with a basic API key, which has a rate
limit of 6 hours between changes. Overriding is possible with an
override key, which should be used as an escape hatch.

Usage:
- API key provided in header `Authorization: Bearer <KEY>`
- Body has shape `{ tags: string[] }`
This commit is contained in:
Charis
2024-09-19 14:28:07 -04:00
committed by GitHub
parent 6fec12a524
commit dfda9da26d
6 changed files with 612 additions and 24 deletions

View File

@@ -13,7 +13,15 @@
},
"docs#build": {
"dependsOn": ["^build"],
"env": ["ANALYZE", "NEXT_PUBLIC_*", "NODE_ENV", "OPENAI_API_KEY"],
"env": [
"ANALYZE",
"DOCS_REVALIDATION_KEYS",
"DOCS_REVALIDATION_OVERRIDE_KEYS",
"NEXT_PUBLIC_*",
"NODE_ENV",
"OPENAI_API_KEY",
"SUPABASE_SECRET_KEY"
],
"outputs": [".next/**", "!.next/cache/**"]
},
"studio#build": {