GitHub Actions: पहली CI Pipeline
Read this guide in: English · मराठी · हिंदी
Why GitHub Actions चाहिए? क्योंकि developers और operations के बीच problem है। Developers push कर कहते हैं “laptop पर test किया।” Operations — server side — Friday night पाता है कि shared checks किसी ने नहीं चलाए। पहली CI pipeline हर push पर वही command चलाती है — deploy बहस से पहले दोनों पक्षों को pass/fail दिखे।
संक्षिप्त उत्तर
- Developer — GitHub पर code push करता है।
- Operations — server-side person जो सिर्फ़ checks पास builds देखे।
- Problem — “locally test किया” vs टूटा production; shared log नहीं।
- GitHub Actions —
.github/workflows/YAML push पर चलता है। - Pocket: push → runner checkout → steps green.
Language: English · मराठी · हिंदी
Problem? Suppose we are…
Suppose we are building Instagram (like updates)
Profile badge push tests skip करता है। Laptop ठीक। Production टूटता है। Operations के पास CI log नहीं — सिर्फ़ blame।
Suppose we are working at Netflix and we are giving updates
दिन में कई pushes। Manual “कृपया tests चलाएँ” scale नहीं होता। हर push पर वही automated check चाहिए।
Suppose you are working in Infosys on a client project
Client operations कहता है: “Deploy से पहले pipeline result दिखाओ।” Green GitHub Actions run वही proof।
A git push starts a workflow from .yml: checkout on a runner, run steps, report pass or fail.
Teaching diagram of a first GitHub Actions ci.yml shape — no live GitHub login required to learn the idea.
Actions कैसे जवाब देता है
.github/workflows/ci.yml:
name: ci
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Show repo files
run: ls -la
- name: Simple check
run: test -f README.md
mkdir -p .github/workflows
git add .github/workflows/ci.yml
git commit -m "Add GitHub Actions CI workflow"
git push
GitHub → Actions → run देखो। एक बार जान‑बूझकर fail करो, red log पढ़ो। Secrets Settings में, repo में नहीं।
Ravindra Bagale's Tip
पहले दिन पाँच deploy jobs मत चिपकाओ। Checkout + एक ईमानदार check। Green होने पर build/test बढ़ाओ। याद रखो।
Learn it properly
Samajla ka? Why Actions = “laptop test” vs server-side surprises रोकें; Instagram / Netflix / Infosys “suppose”; push CI शुरू करता है।
Frequently asked questions
What is GitHub Actions?
GitHub’s built-in CI/CD: workflows run on GitHub-hosted (or self-hosted) runners when events happen.
What is a workflow?
A YAML file under .github/workflows that lists jobs and steps.
What is a runner?
The machine that executes your job (for example ubuntu-latest).
Is Actions free for public repos?
GitHub offers free minutes for public repositories; check current GitHub billing docs for private repos.
Do I need Docker in Actions on day one?
No. Start with checkout plus a simple shell or language setup action.
How do secrets work?
Store tokens in repo Settings → Secrets and reference them as ${{ secrets.NAME }} — never commit secrets.