Skip to content

Commit

Permalink
Merge pull request #14 from TempleDAO/feat/vercel-build-script
Browse files Browse the repository at this point in the history
feat: add vercel build script
  • Loading branch information
zelkibuilds authored Dec 14, 2021
2 parents 4bd85fa + 5e44ad7 commit 3280de0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 9 additions & 0 deletions vercel-build.js
Original file line number Diff line number Diff line change
@@ -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);
}
5 changes: 4 additions & 1 deletion vercel.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"rewrites": [{ "source": "/(.*)", "destination": "/" }]
"rewrites": [{ "source": "/(.*)", "destination": "/" }],
"github": {
"silent": true
}
}

0 comments on commit 3280de0

Please sign in to comment.