နားလည်ထားရမယ့် အချက်
Vercel နှင့် Netlify က core problem တစ်ခုတည်းကို နည်းလမ်းတူညီစွာ ဖြေရှင်းပေးသည် -- git repository ကို manual deployment အနည်းဆုံးနဲ့ live website ဖြစ်အောင် ပြောင်းပေးခြင်းပါ။
- Git integration ဖြင့် push တိုင်း automatic build ဖြစ်ခြင်း။
- User အစစ်ကို မရောက်ခင် branch (သို့) pull request တစ်ခုချင်းစီအတွက် preview deployment ရရှိခြင်း။
- Main branch ဆီ merge လုပ်တာနဲ့ production deployment အလိုအလျောက် ဖြစ်ခြင်း။
- Frontend/full-stack runtime support နှင့် backend logic အတွက် serverless/edge function များ။
- Custom domain နှင့် environment variable တွေကို first-class configuration အဖြစ် ကိုင်တွယ်ခြင်း။
Vercel ဖြစ်စေ Netlify ဖြစ်စေ React, Next.js (သို့) framework တခြားတစ်ခုကို build/run လုပ်ဖို့ မဖြစ်မနေ မလိုအပ်ပါ။ ဒါတွေက hosting ရွေးချယ်စရာများထဲက deployment platform တစ်ခုသာဖြစ်ပြီး framework ကိုယ်တိုင်ရဲ့ dependency မဟုတ်ပါ။
တစ်ခုစီက သမိုင်းကြောင်းအရ ပိုကောင်းတဲ့ area ရှိခဲ့ပေမယ့် platform နှစ်ခုစလုံး တိုးတက်လာသလို အဲဒါတွေ ပြောင်းလဲနေပါတယ်။ ပုံသေ reputation ကို မယုံဘဲ project အတွက် လက်ရှိ capability ကို ရွေးချယ်တိုင်း စစ်ဆေးပါ။
THE SHARED GIT-BASED DEPLOYMENT SHAPE
-------------------------------------
Git Push
|
v
Build
|
v
Preview Deployment <-- feature branches / pull requests
|
v
(review)
|
v
Merge to main
|
v
Production Deployment
|
v
CDN / Runtimeလက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
Git repository ချိတ်လိုက်ရင် platform က framework ကို detect လုပ်ပြီး build ကို auto-configure လုပ်ပေးပါတယ် -- manual server setup မလိုပါ။
Push ပြီး preview ကြည့်ပါ
Feature branch push က pull request ပေါ်မှာ share ချနိုင်တဲ့ preview URL တစ်ခု ထုတ်ပေးပါတယ်။
Review လုပ်ပြီး merge ပါ
Reviewer တွေက user အစစ်ကို မရောက်ခင် live preview ကို click လုပ်ကြည့်နိုင်ပါတယ်။
Production ကို အလိုအလျောက် deploy
Main ဆီ merge လုပ်တာနဲ့ manual step တစ်ခုမှမလိုဘဲ production deployment ဖြစ်ပါတယ်။
Environment variable တွေကို code ထဲ commit မလုပ်ဘဲ project (တစ်ခါတစ်ရံ environment) အလိုက် configure လုပ်ပါတယ်၊ custom domain ကတော့ standard DNS နဲ့ automatic certificate ဖြင့် ချိတ်ပါတယ်။
အလေ့အထ (သို့) hype ကြောင့်သာ platform ရွေးချယ်ခြင်းကို ရှောင်ပါ -- project အစစ်နဲ့ ကိုက်ညီမကိုက်ညီ build limit, function runtime, framework support တွေကို လက်ရှိအခြေအနေအတိုင်း စစ်ဆေးပါ။
အတူတူ စမ်းရေးကြည့်မယ်
function classifyDeployment(push) {
// push: { branch: string, isDefaultBranch: boolean }
if (push.isDefaultBranch) {
return "Production Deployment";
}
return "Preview Deployment";
}
const events = [
{ branch: "feature/new-pricing-page", isDefaultBranch: false },
{ branch: "main", isDefaultBranch: true },
];
for (const event of events) {
console.log(`push to "${event.branch}" -> ${classifyDeployment(event)}`);
}push to "feature/new-pricing-page" -> Preview Deployment
push to "main" -> Production Deployment
(Feature branch push က preview ဖြစ်ပြီး main branch push က production ဖြစ်ကြောင်း output က ပြသည်။)၅ မိနစ် စမ်းကြည့်
ရင်းနှီးတဲ့ project တစ်ခုအတွက် Vercel (သို့) Netlify ကဲ့သို့ git-based platform မှာ deploy လုပ်ရင် feature-branch push နဲ့ main-branch push မှာ ဘာဖြစ်မလဲ ရေးဆွဲကြည့်ပါ။ Merge မတိုင်ခင် reviewer တွေ ဘာမြင်ရမလဲ?
သတိလေးတစ်ချက်
Vercel သို့မဟုတ် Netlify ကို framework တစ်ခု deploy လုပ်ဖို့ official နည်းလမ်းအဖြစ် ယူဆခြင်း -- အမှန်တကယ် valid hosting choice များစွာထဲက နှစ်ခုသာ ဖြစ်သည်။
တစ်နှစ် နှစ်နှစ်ခန့်က platform ရဲ့ ကောင်းချက်များ (build time, function limit, framework support) ကို ယနေ့ချိန်အထိ မှန်ကန်နေဆဲဟု ယူဆခြင်း။
Wikipedia: Continuous deployment — Cloud Providers & Platforms