DEV Community

Kyle Y. Parsotan
Kyle Y. Parsotan

Posted on

Github Action Core part of Automation

GitHub Actions is GitHub’s built-in system for automating tasks in your repoβ€”like testing code, building apps, and deploying projects.

It’s a core part of CI/CD (Continuous Integration / Continuous Deployment) used in real software companies.


πŸš€ GitHub Actions (CI/CD Automation Basics)

🧠 What is CI/CD?

CI = Continuous Integration

Automatically tests your code every time you push changes.

CD = Continuous Deployment

Automatically deploys your app when code is ready.

πŸ‘‰ In simple terms:

Push code β†’ GitHub runs checks β†’ If everything passes β†’ deploy or approve


βš™οΈ What are GitHub Actions?

GitHub Actions lets you create workflows that run automatically when something happens in your repo.

Examples:

  • Push code β†’ run tests
  • Open Pull Request β†’ check code quality
  • Merge to main β†’ deploy website
  • Schedule task β†’ run every day

🧩 Key Concepts

🟑 Workflow

A full automation process (YAML file)

Example:

β€œRun tests and deploy app”


🟒 Event

What triggers the workflow

Examples:

  • push
  • pull_request
  • schedule

πŸ”΅ Job

A group of steps that run on a machine


🟣 Step

Individual command or action


πŸ–₯️ Runner

The machine that executes your workflow (Linux, Windows, Mac)


πŸ“ 3. Where GitHub Actions live

They are stored in:

```plaintext id="g7m3tq"
.github/workflows/




Example file:



```plaintext id="2kqz91"
.github/workflows/nodejs.yml
πŸ† Live Soccer TV: kyl/github action core part of automation - Info Live Streaming 2026 πŸ† Live Soccer TV: kyl/github action core part of automation - Info Live Streaming 2026

πŸ› οΈ First Simple GitHub Action (Hello World CI)

Create this file:

```yaml id="7xkq1p"
name: Basic CI

on:
push:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
  - name: Checkout code
    uses: actions/checkout@v4

  - name: Say Hello
    run: echo "Hello, GitHub Actions!"
πŸ† Live Soccer TV: kyl/github action core part of automation - Info Live Streaming 2026 πŸ† Live Soccer TV: kyl/github action core part of automation - Info Live Streaming 2026



### What happens?

Every time you push to `main`, GitHub prints:



```plaintext
Hello, GitHub Actions!
πŸ† Live Soccer TV: kyl/github action core part of automation - Info Live Streaming 2026 πŸ† Live Soccer TV: kyl/github action core part of automation - Info Live Streaming 2026

πŸ§ͺ Real CI Example (Node.js project)

This is what real developers use:

```yaml id="k3n8dj"
name: Node.js CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

steps:
  - uses: actions/checkout@v4

  - name: Setup Node
    uses: actions/setup-node@v4
    with:
      node-version: 20

  - name: Install dependencies
    run: npm install

  - name: Run tests
    run: npm test
πŸ† Live Soccer TV: kyl/github action core part of automation - Info Live Streaming 2026 πŸ† Live Soccer TV: kyl/github action core part of automation - Info Live Streaming 2026



---

# πŸš€ Simple CD (Deployment Example)

Example: Deploy to server or hosting after push



```yaml id="8v2q9m"
name: Deploy App

on:
  push:
    branches: [ main ]

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install dependencies
        run: npm install

      - name: Build project
        run: npm run build

      - name: Deploy
        run: echo "Deploying app..."
πŸ† Live Soccer TV: kyl/github action core part of automation - Info Live Streaming 2026 πŸ† Live Soccer TV: kyl/github action core part of automation - Info Live Streaming 2026

(Real deployments would connect to Vercel, AWS, etc.)


πŸ”₯ Common GitHub Actions Use Cases

πŸ§ͺ Testing

  • Run unit tests
  • Run lint checks

πŸ—οΈ Build automation

  • Compile code
  • Build React/Next.js apps

πŸš€ Deployment

  • Deploy to Vercel, AWS, Firebase, Netlify

πŸ” Security checks

  • Scan dependencies
  • Check vulnerabilities

πŸ€– Automation

  • Auto-label PRs
  • Auto-comment on issues
  • Run scheduled jobs

🧠 GitHub Actions in real life

A real workflow looks like:

  1. Developer pushes code
  2. GitHub runs tests automatically
  3. If tests pass β†’ PR allowed
  4. Merge to main
  5. App is automatically deployed

πŸ‘‰ This removes manual work completely.


⚠️ Common beginner mistakes

❌ Wrong YAML spacing

YAML is sensitiveβ€”indentation matters.

❌ Missing checkout step

You must include:

```yaml id="f1p9sl"
uses: actions/checkout@v4




### ❌ Not specifying trigger (on:)

Without it, workflow won’t run.

### ❌ Overcomplicating workflows

Start simple β†’ add complexity later.

---

# 🧭 Basic GitHub Actions structure



```plaintext id="c7m2kf"
on: (trigger event)

jobs:
  job-name:
    runs-on: machine-type
    steps:
      - action
      - run command
πŸ† Live Soccer TV: kyl/github action core part of automation - Info Live Streaming 2026 πŸ† Live Soccer TV: kyl/github action core part of automation - Info Live Streaming 2026

πŸ’‘ Final Summary

GitHub Actions = automation for your GitHub repo

You use it to:

  • Test code automatically
  • Build projects
  • Deploy apps
  • Save time
  • Prevent bugs

Top comments (0)