44a3ea7363
This PR makes it so that our docs deployment process is tied to, and mirrors, the npm deployment process. From here on: - Commits to main get deployed to staging.tldraw.dev - Commits to a special protected branch called `docs-production` get deployed to www.tldraw.dev - Whenever we create a new npm 'latest' release we reset the HEAD of docs-production to point to the tagged commit for that release. - If we make a docs change that we want to appear on tldraw.dev ASAP without waiting for the next npm release, we'll have to follow the same process as for creating a patch release i.e merge a cherry-pick PR targeting the latest release branch e.g. `v2.0.x`. This will not cause another npm patch release unless the cherry-picked changes touch source files, e.g. updating TSDoc comments. ### Change Type - [x] `docs` — Changes to the documentation, examples, or templates. - [x] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc.
17 lines
396 B
Bash
Executable file
17 lines
396 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -eux
|
|
|
|
if [[ "$VERCEL_ENV" == "production" ]] ; then
|
|
echo "Always build on production";
|
|
exit 1;
|
|
fi
|
|
|
|
## main is not production anymore, but we still always want to build it
|
|
if [[ "$VERCEL_GIT_COMMIT_REF" == "main" ]] ; then
|
|
echo "Always build on main";
|
|
exit 1;
|
|
fi
|
|
|
|
## on PR builds, only rebuild if the docs directory changed
|
|
git diff HEAD^ HEAD --quiet ./apps/docs
|
|
|