بناء الصورة ودفعها عند الإصدار
أتمت بناء الحاويات عند وسم إصدار.
بناء الصورة ودفعها عند الإصدار درس مجاني في MLOps Academy على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في MLOps Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة MLOps Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Build Only on Release
You do not ship an image on every commit. The release step builds and publishes a container only when you mark a version as ready. 📦
Trigger on a Tag
A common pattern fires the build when you push a git tag like v1.2.0, so a deliberate version, not a casual push, starts the deploy.
on:
push:
tags: ["v*"]What a Build Produces
The build packs your model API, its code, and dependencies into one image: a frozen, runnable snapshot that behaves the same on any machine.
A Registry Stores Images
A container registry like GHCR, ECR, or Docker Hub is where built images live so any server can later pull and run them.
Log In With a Secret
Before pushing, the workflow logs into the registry using a stored secret, never a hardcoded password, keeping credentials out of your code.
- uses: docker/login-action@v3
with:
password: ${{ secrets.REGISTRY_TOKEN }}Tag the Image Well
Give the image a clear tag that matches your release version. Reusing latest alone makes it impossible to tell which build is running.
myorg/model-api:v1.2.0Build and Push in One Action
The official Docker build-push action builds your Dockerfile and uploads the result to the registry in a single step.
- uses: docker/build-push-action@v6
with:
push: true
tags: myorg/model-api:v1.2.0Pin the Version, Not latest
Deploying a pinned tag like v1.2.0 means you always know exactly which model and code are live, and you can roll back to an earlier tag fast.
Cache Layers for Speed
Image builds reuse unchanged layers from a cache, so only the parts you actually changed rebuild. This keeps release builds quick.
Deploy Pulls the Image
Once pushed, your runtime simply pulls the tagged image and starts it. The same artifact you tested is the one that goes live, byte for byte.
docker pull myorg/model-api:v1.2.0Release Notes Close the Loop
Tie the image tag to a GitHub release with notes on what changed. Now anyone can trace a running container back to its exact code and model.
Quick Check
Why tag the released image with a version instead of only latest?
Recap
On a version tag, log in with a secret, build the image, and push it to a registry under a pinned tag. Your runtime pulls that exact artifact to go live.
الأسئلة الشائعة
هل درس «بناء الصورة ودفعها عند الإصدار» مجاني؟
نعم — نص درس «بناء الصورة ودفعها عند الإصدار» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة MLOps Academy، انتقل إلى CoddyKit PRO. تتضمن دورة MLOps Academy 4 دروس في المجموع.
ماذا ستتعلم في «بناء الصورة ودفعها عند الإصدار»؟
أتمت بناء الحاويات عند وسم إصدار. تتمرن على MLOps Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ MLOps Academy؟
لا تُشترط خبرة سابقة. MLOps Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «بناء الصورة ودفعها عند الإصدار»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس MLOps Academy هذا؟
نعم. كل درس في MLOps Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- ماذا تعني CI/CD للنماذج
- سير عمل GitHub Actions لتعلّم الآلة
- اشتراط جودة النموذج لدمج التغييرات
- بناء الصورة ودفعها عند الإصدار