Git CI/CD Pipeline Basics
In this page:
CI/CD क्या है?
CI/CD का मतलब है Continuous Integration और Continuous Deployment। यह हर commit पर आपके code का testing, building, और deployment automate करने की practice है। यह cookiescursor.com पर आपके utility tools को stable और error-free रखता है।
उदाहरण: What is CI/CD?
# .github/workflows/ci-cd.yml
on: push
jobs:
build:
runs-on: ubuntu-latest
Push पर Tests Automate करना
Continuous Integration का मतलब है हर push पर automatically आपकी test suite चलाना, ताकि एक टूटा हुआ change दिनों बाद discover होने के बजाय, जब किसी और का काम इससे टकराए, मिनटों में flag हो जाए।
उदाहरण: Automating Tests on Push
on:
push:
jobs:
test:
steps:
- run: npm test
Build Artifacts Manage करना
एक बार tests pass हो जाएँ, pipeline project compile कर सकता है और resulting binaries या archives को build artifacts की तरह upload कर सकता है — run के summary page से downloadable, और scratch से rebuild किए बिना एक बाद के deployment step द्वारा reusable।
उदाहरण: Managing Build Artifacts
steps:
- run: npm run build
- uses: actions/upload-artifact@v4
with:
name: build
path: dist/
Environment Secrets Integrate करना
एक workflow file में सीधे एक API key या database password hardcode करना इसे repository पढ़ सकने वाले किसी को भी expose कर देता है। Repository secrets rest पर encrypted होते हैं और सिर्फ run के दौरान environment variables की तरह inject होते हैं, उन्हें actual source code से बाहर रखते हुए।
उदाहरण: Integrating Environment Secrets
steps:
- run: deploy.sh
env:
API_KEY: ${{ secrets.API_KEY }}
Pipeline Status Badges
आप अपने README.md file के अंदर सीधे एक markdown status badge इस्तेमाल करके अपना active build status दिखा सकते हैं। यह visitors को दिखाता है कि आपकी codebase इस समय successfully compile हो रही है या नहीं।
उदाहरण: Pipeline Status Badges

- pipeline में tests skip करना और सिर्फ build करना, ताकि टूटा हुआ code अभी भी deploy हो जाए।
- workflow file में API keys जैसे secrets commit करना, जबकि उन्हें encrypted secrets की तरह store किया जाना चाहिए।
- एक red pipeline को ignore करना और फिर भी merge करना, जो continuous integration का purpose खत्म कर देता है।
Chapter Quiz — Complete all 5 topics to unlock
0/5 topics done
Complete these topics first: