From 4c4ade991e7fe95a5afb0c3040c0d68efbade618 Mon Sep 17 00:00:00 2001 From: Somnath Chataraj Date: Fri, 24 May 2024 19:42:09 +0530 Subject: [PATCH] Add github workfow --- .github/workflows/build.yml | 59 +++++++++++++++++++++++++++++++++++++ frontend/src/App.jsx | 2 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1ff7f97 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,59 @@ +name: CI/CD + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + + runs-on: ubuntu-latest + + services: + mongodb: + image: mongo:latest + ports: + - 27017:27017 + options: >- + --health-cmd="mongo --eval 'db.runCommand({ ping: 1 })'" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: Cache backend node modules + uses: actions/cache@v2 + with: + path: backend/node_modules + key: backend-${{ runner.os }}-node_modules-${{ hashFiles('backend/package-lock.json') }} + restore-keys: | + backend-${{ runner.os }}-node_modules- + + - name: Cache frontend node modules + uses: actions/cache@v2 + with: + path: frontend/node_modules + key: frontend-${{ runner.os }}-node_modules-${{ hashFiles('frontend/package-lock.json') }} + restore-keys: | + frontend-${{ runner.os }}-node_modules- + + - name: Install backend dependencies + run: cd backend && npm install + + - name: Install frontend dependencies + run: cd frontend && npm install + + - name: Build frontend + run: cd frontend && npm run build diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 1763396..823edcc 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -11,7 +11,7 @@ import { ForgotPassword, Login, SignUp } from "./components"; const App = () => { return ( -
+