Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Feat(ops): Add deploy script

Jonathan ARNAULT748f0b43d650
diff --git a/makefile b/makefile
index 9450bc60..464766f8 100644
--- a/makefile
+++ b/makefile
@@ -22,8 +22,11 @@ stop: stop-supabase ## stop the stack locally
build: ## build the app
npm run build
-start-prod: build
+prod-start: build
open http://127.0.0.1:3000 && npx serve -l tcp://127.0.0.1:3000 dist
+prod-deploy: build ## deploy the app to production
+ npm run ghpages:deploy
+
supabase-remote-init:
npm run supabase:remote:init
diff --git a/package.json b/package.json
index d551da2f..ab9d425e 100644
--- a/package.json
+++ b/package.json
@@ -63,6 +63,7 @@
"preview": "vite preview",
"lint": "eslint --ext .js,.ts,.tsx \"./src/**/*.{js,ts,tsx}\"",
"prettier": "prettier --config ./.prettierrc.mjs --write --list-different \"src/**/*.{js,json,ts,tsx,css,md}\"",
+ "ghpages:deploy": "node ./scripts/ghpages-deploy.mjs",
"supabase:remote:init": "node ./scripts/supabase-remote-init.mjs"
}
}
diff --git a/scripts/ghpages-deploy.mjs b/scripts/ghpages-deploy.mjs
new file mode 100644
index 00000000..2e88b589
--- /dev/null
+++ b/scripts/ghpages-deploy.mjs
@@ -0,0 +1,7 @@
+import * as ghpages from 'gh-pages';
+
+ghpages.publish('dist', { branch: 'gh-pages' }, function (err) {
+ if (err) {
+ console.error('Failed to deploy to GitHub Pages', err);
+ }
+});