diff --git a/package.json b/package.json index d6efe0873..7eef2acf3 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "vite", "build": "tsc && vite build", + "vercel-build": "node vercel-build && tsc && vite build", "serve": "vite preview", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook", diff --git a/vercel-build.js b/vercel-build.js new file mode 100644 index 000000000..080572e8b --- /dev/null +++ b/vercel-build.js @@ -0,0 +1,9 @@ +const BRANCH = process.env.VERCEL_GIT_COMMIT_REF; + +const VALID_BUILD_BRANCHES = ['main', 'develop', 'hotfix', 'release']; + +if (VALID_BUILD_BRANCHES.find((validBranch) => validBranch === BRANCH)) { + process.exit(0); +} else { + process.exit(1); +} diff --git a/vercel.json b/vercel.json index 3a48e56ba..70af9d42e 100644 --- a/vercel.json +++ b/vercel.json @@ -1,3 +1,6 @@ { - "rewrites": [{ "source": "/(.*)", "destination": "/" }] + "rewrites": [{ "source": "/(.*)", "destination": "/" }], + "github": { + "silent": true + } }