Files
cozsweet-frontend-nextjs/git_hooks/post-receive
T
admin 4fa1ddf22f chore(hooks): copy env example to production env in post-receive
Add preparation step for production environment variables by copying
.env.production.example to .env.production before running build:start,
ensuring required environment variables are available on deployment.
2026-06-12 14:40:07 +08:00

15 lines
499 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# Post-receive hook: push 后自动 build + start
#
# 触发场景:
# - 非 bare repo + receive.denyCurrentBranch=updateInstead:本地推送自动部署
#
# 用途:执行 package.json 中的 `build:start` 脚本
# - 内部 = `npm run build && npm run start`
# - 实际调用 `pnpm run build:start`(项目使用 pnpm
# 准备生产环境变量(从 .env.production.example 复制 → .env.production
cp -f .env.production.example .env.production
pnpm run build:start