OR REACH ME ON

    CI/CD with GitHub Actions for Full-Stack Apps

    After learning Docker, the next challenge I faced was automation. Manually building, testing, and deploying apps was slow and error-prone. That’s when I set up CI/CD with GitHub Actions for the first time — and it changed how I shipped software.

    Why CI/CD Matters

    • CI (Continuous Integration)  Every push runs tests automatically.

    • CD (Continuous Deployment)  Code merges trigger automated deployments.

    • Benefits: Faster feedback, fewer broken builds, smoother team collaboration.

    Basic GitHub Actions Workflow

    Here’s a simple workflow I used for a Rails + React app:

    				
    					# .github/workflows/ci-cd.yml
    name: CI/CD
    
    on:
      push:
        branches: [ "main" ]
      pull_request:
        branches: [ "main" ]
    
    jobs:
      build:
        runs-on: ubuntu-latest
    
        services:
          postgres:
            image: postgres:14
            ports: ["5432:5432"]
            env:
              POSTGRES_USER: postgres
              POSTGRES_PASSWORD: password
    
        steps:
          - uses: actions/checkout@v3
    
          # Backend (Rails)
          - name: Set up Ruby
            uses: ruby/setup-ruby@v1
            with:
              ruby-version: 3.1
    
          - name: Install Gems
            run: bundle install
    
          - name: Run RSpec Tests
            run: bundle exec rspec
    
          # Frontend (React)
          - name: Set up Node
            uses: actions/setup-node@v3
            with:
              node-version: 16
    
          - name: Install NPM Packages
            run: npm install --prefix frontend
    
          - name: Run React Tests
            run: npm test --prefix frontend
    				
    			

    Adding Deployment

    Once tests passed, I extended the workflow to build and push Docker images:

    				
    					- name: Build & Push Docker Image
      run: |
        docker build -t myapp-backend ./backend
        docker build -t myapp-frontend ./frontend
        echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
        docker push myorg/myapp-backend
        docker push myorg/myapp-frontend
    				
    			

    This meant every successful push on main produced production-ready images.

    Real Benefits I Saw

    1. Confidence  Every commit was tested before merge.

    2. Speed   Deployments became a one-click (or no-click) process.

    3. Teamwork  No more “it worked locally but broke in staging.”

    4. Consistency  Same process ran every time, no human shortcuts.

    🎯 Final Thoughts

    CI/CD with GitHub Actions turned my workflow from manual and risky into automated and reliable.

    By the end of 2022, Docker + GitHub Actions became my standard setup for full-stack apps — and I still use the same foundation today, just with more advanced pipelines.