Full Stack Development

Continuous Integration (CI)



by Tomas Trescak t.trescak@westernsydney.edu.au

CI/CD

/

Introduction

Developer
User

CI/CD

/

Introduction

CI/CD

/

Introduction

  • What is CI/CD?
    • Continuous Integration and Continuous Deployment
  • Software Works Everywhere
  • 👺 Myth : I can test it myself!

CI/CD

/

Introduction

  • CI: Teamwork made easy
  • CD: Launch with confidence
  • Quick Feedback Loop
  • Security
https://spectralops.io

CI/CD

/

Infinity Loop

CI/CD

/

Github Actions

    # .github/workflows/ci.yml
name: CI Pipeline
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '18'
      - name: Install PNPM 📦
        uses: pnpm/action-setup@v4
        with:
          version: 10.4.1
      - name: Install Dependencies
        run: pnpm install
      - name: Run Tests
        run: pnpm test
      - name: Build Project
        run: pnpm run build
  

CI/CD

/

Case Study

  • Scenario: Blog App Live
  • Delete Post Without CI/CD -> All Post Deleted
  • CI/CD Catches Bug
  • CI/CD Saves Time

CI/CD

/

Try It

  • Add a small change (or a bug)
  • Push it
  • Watch GitHub Actions catch it
    https://github.com/WesternSydneyUniversity/comp3036-ci-cd-introduction
  

CI/CD

/

Try It Locally! 🥸

CI/CD

/

Alternatives

Ease of Use : ✅ Github Actions
Cost: ✅ Github Actions
Flexibility: ✅ Jenkins
Community: ✅Github Actions

CI/CD

/

Wrap Up

  • CI/CD saves the day
  • GitHub Actions rocks
  • Automate early, test everything
  • Don’t skip tests