Lesson 85/100

Tutorials MEAN Stack Tutorial

GitHub Actions — Complete Guide

GitHub Actions — Complete Guide: free step-by-step lesson with examples, common mistakes, and interview tips — part of MEAN Stack Tutorial on Toolliyo Academy.

On this page

MEAN Stack Tutorial · Lesson 85 of 100

GitHub Actions

Stack ✓Projects

Projects · 2 — Apps · ~10 min · MEAN — DevOps & Deployment

What is this?

GitHub Actions CI runs MeanVerse tests, builds Docker images, and deploys on every push via workflow YAML.

Why should you care?

Manual deploys skip tests; automation enforces quality gate.

See it live — copy this example

Paste into your MeanVerse project (Angular + Express + MongoDB), then run with ng serve / node / mongosh as noted.

# .github/workflows/api-ci.yml
name: API CI
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    services:
      mongo: { image: mongo:7, ports: ['27017:27017'] }
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: '20' }
      - run: npm ci
        working-directory: api
      - run: npm test
        working-directory: api
        env: { MONGO_URI: mongodb://localhost:27017/meanverse_test }
  build:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: docker/build-push-action@v6
        with: { push: true, tags: ghcr.io/meanverse/api:${{ github.sha }} }

What happened?

  • push triggers workflow.
  • mongo service container for integration tests.
  • build job pushes image tagged with git sha for traceability.

Practice next

  1. Add workflow on pull_request to main.
  2. Cache npm with actions/cache.
  3. Fail PR if lint or test fails.
  4. Add deploy job to AKS with kubectl.
  5. Run npm audit in workflow fail on critical.

Remember

Actions = CI/CD in repo. Test before build and deploy. Image tag = git sha for rollback.

PR quality gate

Junior dev breaks transfer validation.

Outcome: CI fails; merge blocked until fix — prod safe.

Interview prep for this lesson

Practice these questions aloud after reading—each links to a full structured answer.

Junior Detailed
Explain JavaScript in the context of MEAN Stack.
Short answer: JavaScript runs single-threaded with an event loop. Closures capture lexical scope; promises/async handle I/O without blocking the UI thread. Real-world example (ShopNest) On the ShopNest storefront UI, thi…
Mid Detailed
What are common mistakes teams make with Components when using MEAN Stack?
Short answer: Interviewers want a crisp definition, a practical example from your projects, and awareness of trade-offs—not textbook dumps. Explain a bit more How to structure your answer (60–90 seconds) Define Component…
Senior Detailed
How would you debug a production issue related to State in a MEAN Stack application?
Short answer: Interviewers want a crisp definition, a practical example from your projects, and awareness of trade-offs—not textbook dumps. Explain a bit more How to structure your answer (60–90 seconds) Define State in…
Junior Detailed
Describe a real-world scenario where Performance mattered in a MEAN Stack project.
Short answer: Interviewers want a crisp definition, a practical example from your projects, and awareness of trade-offs—not textbook dumps. Explain a bit more How to structure your answer (60–90 seconds) Define Performan…
Questions on this lesson 0

Sign in to ask a question or upvote helpful answers.

No questions yet — be the first to ask!

MEAN Stack Tutorial
Course syllabus

MEAN Tutorial

MEAN — Stack Foundations
MEAN — Fundamentals
MEAN — TypeScript & RxJS
MEAN — Node.js & Express
MEAN — & Databases
MEAN — Authentication & Security
MEAN — Real-Time & Advanced Systems
MEAN — Performance & Testing
MEAN — DevOps & Deployment
MEAN — Enterprise Projects
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details