Repository navigation
Add Vercel deployment workflows (docs) - #1333
Conversation
|
The deployments were removed when this pull request closed. Reopening it deploys again at the same address. |
bpander
left a comment
There was a problem hiding this comment.
Overall looking really good. Found only a couple blocking issues.
| buildCommand: "bun run build", | ||
| outputDirectory: "_site", | ||
| cleanUrls: true, | ||
| trailingSlash: false, |
There was a problem hiding this comment.
Unfortunately this causes quite a few 404s. Some links are defined in the docs source files as relative, e.g. in [metabase]/docs/README.md there's [cloud vs self-hosting](./cloud/cloud-vs-self-hosting.md).
In production, because /docs/latest/ has a trailing slash, the href resolves to /docs/latest/cloud/cloud-vs-self-hosting which is correct.
But without the trailing slash, it resolves to /docs/cloud/cloud-vs-self-hosting which 404s.
I think there are quite a few relative links. Do we actually need to force it one way or the other?
There was a problem hiding this comment.
Good catch. I believe there's opportunity for consistency & unification here. I changed these settings but I believe I missed updating the Astro build format to avoid trailing slashes
My inclination would be to remove trailing slashes given that there's only 4 out of 489 URLs listed on the sitemap which end with a trailing slash, the majority seems to not have it, so maybe that's a tradeoff worth taking for consistency purposes
There was a problem hiding this comment.
EDIT: I'll hold that thought, the fix wasn't quite as small as I wanted. Went with the simples which is just keeping the existing behavior in prod
| headers: [ | ||
| { | ||
| source: "/", | ||
| has: [{ type: "host", value: { suf: ".vercel.app" } }], |
There was a problem hiding this comment.
I'm pretty sure this will leak into production since docs doesn't have a custom domain. I think you can just use pre instead though since we're just targeting PR envs, e.g.
pre: `${PROJECT_NAME}-pr-`
There was a problem hiding this comment.
Oof, you're right. The underlying proxy from the production marketing deployment will still hit the .vercel.app domain
One thing I remembered we can do is request header deletion in the marketing project's vercel.ts, something like:
{
src: "^/docs(?:/.*)?$",
has: [{ type: "host", value: "metabase.com" }],
transforms: [
{
type: "response.headers",
op: "delete",
target: { key: "x-robots-tag" },
},
],
continue: true,
}Essentially handing control over to marketing, which owns the domain, "unless this app is being accessed via its intended host & path, it won't index".
The pre rule works too, I guess it's a bit too paranoid but it'll still leaves metabase-docs.vercel.app open to being indexed
There was a problem hiding this comment.
Ah yeah I like that option more since it's simple and reasonable and it'd handle metabase-docs.vercel.app too. Good thinking.
There was a problem hiding this comment.
Addressed in the marketing PR: fix: purposefully index docs if accessed via the metabase.com domain
Fixes GRO-956