Skip to content

Commit

Permalink
use script to determine to build in vercel or not
Browse files Browse the repository at this point in the history
Signed-off-by: Vu Nguyen <[email protected]>
  • Loading branch information
vujita committed Sep 15, 2024
1 parent a0e778d commit eaa60f6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/bin/bash

echo "VERCEL_ENV: $VERCEL_ENV"
env
echo "VERCEL_GIT_COMMIT_REF: $VERCEL_GIT_COMMIT_REF"

if [[ "$VERCEL_ENV" == "production" ]]; then
# Proceed with the build
echo "✅ - Build can proceed"
exit 1

else
if [[ "$VERCEL_GIT_COMMIT_REF" == "gh-pages" ]]; then
# Don't build
echo "🛑 - Build cancelled"
exit 0
else
# Proceed with the build
echo "✅ - Build can proceed"
exit 1
fi
3 changes: 0 additions & 3 deletions packages/vujita-ui/files/vercel.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/vujita-ui/xclap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ xrun.load({
"build:clean": xrun.exec("rimraf storybook-static coverage dist"),
"build:lib": xrun.serial(xrun.exec("tsc -p tsconfig.build.json"), xrun.exec("tsc-alias -p tsconfig.build.json"), xrun.exec("tailwind -i src/index.css -o dist/index.css")),
"build:watch": ["build:lib", xrun.concurrent(xrun.exec("tsc -p tsconfig.build.json --watch"), xrun.exec("tsc-alias -p tsconfig.build.json --watch"))],
"storybook:build": xrun.serial("build:lib", xrun.exec("storybook build"), xrun.exec("cp files/vercel.json storybook-static/")),
"storybook:build": xrun.serial("build:lib", xrun.exec("storybook build")),
});

0 comments on commit eaa60f6

Please sign in to comment.