Ravindra BagaleCourses & study guides Track your progress

Guides

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 दिखे।

संक्षिप्त उत्तर

  1. Developer — GitHub पर code push करता है।
  2. Operations — server-side person जो सिर्फ़ checks पास builds देखे।
  3. Problem — “locally test किया” vs टूटा production; shared log नहीं।
  4. GitHub Actions — .github/workflows/ YAML push पर चलता है।
  5. 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।

GitHub Actions CI pipeline on every push A git push starts a workflow from .yml: checkout the repo, run job steps on a runner, then report pass or fail. git push to main Workflow ci.yml on: push Job · runner 1. checkout 2. ls / test 3. report Result ✓ pass / fail CI proof before deploy Diagram of the YAML idea — no live GitHub login required to learn the shape

A git push starts a workflow from .yml: checkout on a runner, run steps, report pass or fail.

GitHub Actions YAML concept Teaching diagram of a first ci.yml workflow shape without requiring a live GitHub login.

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.