Skip to content

feat(home): premium homepage redesign with procedural 3D hero #66

feat(home): premium homepage redesign with procedural 3D hero

feat(home): premium homepage redesign with procedural 3D hero #66

Workflow file for this run

name: CI/CD Pipeline for Fusion Electronics App
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
formatting:
name: "🔧 Install, Lint & Format"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies (root)
run: npm install
- name: Run Prettier
run: npm run format
backend:
name: "✅ Backend Tests"
needs: formatting
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install & Test Backend
working-directory: backend
run: |
npm install
npm test
frontend:
name: "🌐 Frontend Tests"
needs: formatting
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install & Test Frontend
run: |
npm install
npm test
recommendation-tests:
name: "🤖 Recommendation Service Sanity"
runs-on: ubuntu-latest
needs: formatting
strategy:
matrix:
scenario: [ cold-start, diversity, performance ]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
working-directory: backend
run: npm install
- name: Run Scenario ${{ matrix.scenario }}
working-directory: backend
run: |
echo "🧪 Running recommendation test for scenario: ${{ matrix.scenario }}"
# trivial matrix-based test: compute a sample similarity matrix
node -e "\
const scenarios = { \
'cold-start': [[0,1],[1,0]], \
'diversity': [[1,0.5],[0.5,1]], \
'performance': [[1,1],[1,1]] \
}; \
console.table(scenarios['${{ matrix.scenario }}']);\
"
complete:
name: "🎉 All Tests Passed"
needs:
- backend
- frontend
- recommendation-tests
runs-on: ubuntu-latest
steps:
- name: Notify success
run: echo "✅ Backend, frontend, and recommendation tests all passed."
docker:
name: "🐳 Build & Push Docker Images"
needs: complete
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # for GHCR
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & push backend image
uses: docker/build-push-action@v3
with:
context: .
file: ./backend/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/mern-ecom-backend:${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/mern-ecom-backend:latest
- name: Build & push frontend image
uses: docker/build-push-action@v3
with:
context: ./
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/mern-ecom-frontend:${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/mern-ecom-frontend:latest
summary:
name: "🎉 Pipeline Done"
needs:
- docker
runs-on: ubuntu-latest
steps:
- name: CI/CD Pipeline Summary (log)
run: |
echo "::group::📝 Fusion Electronics CI/CD Pipeline Summary"
echo ""
echo "- 🔧 **Formatting:** ✅"
echo "- ✅ **Backend Tests (multi-OS):** ✅"
echo "- 🌐 **Frontend Tests (Node 18 & 20):** ✅"
echo "- 🤖 **Recommendation Service Sanity:** ✅"
echo "- 🐳 **Docker Build & Push:** ✅"
echo ""
echo "✅ All stages completed successfully!"
echo "::endgroup::"
- name: Write Summary to GitHub Step Summary
run: |
{
echo "## 🎉 Fusion Electronics CI/CD Pipeline Complete"
echo ""
echo "| Item | Status |"
echo "| -------------------------------- | --------------------------------------------------- |"
echo "| **Formatting** | ✅ Installed, linted & formatted |"
echo "| **Backend Tests (multi-OS)** | ✅ ubuntu·windows·macOS |"
echo "| **Frontend Tests (Node 18 & 20)**| ✅ Node 18·Node 20 |"
echo "| **Recommendation Service** | ✅ cold-start·diversity·performance |"
echo "| **Docker Build & Push** | ✅ backend & frontend images pushed to GHCR |"
echo ""
echo "**Completed at** $(date -u '+%Y-%m-%dT%H:%M:%SZ') UTC"
} >> $GITHUB_STEP_SUMMARY