Skip to content

- fix error mongodb in run tests #18

- fix error mongodb in run tests

- fix error mongodb in run tests #18

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
jobs:
build-backend:
name: Build and Test Backend
runs-on: ubuntu-latest
services:
mongo:
image: mongo:latest
ports:
- 27017:27017
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install -r backend/requirements.txt
- name: Run Tests
working-directory: ./backend
env:
MONGO_URI: "mongodb://localhost:27017/test_db"
run: |
source ../venv/bin/activate
pytest --disable-warnings
build-frontend:
name: Build Frontend
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
working-directory: ./frontend
run: npm install
- name: Build project
working-directory: ./frontend
run: npm run build
deploy-frontend:
runs-on: ubuntu-latest
needs: build-frontend
if: github.ref == 'refs/heads/develop'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: develop
folder: ./frontend/dist
clean: true