-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from tanish35/somnath/v5
Add github workfow
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |