Skip to content

Commit

Permalink
- Add GitHub Actions workflow for CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
jprogram committed Jul 12, 2024
1 parent 4e42916 commit 84d2676
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: CI/CD Pipeline

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

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: Install dependencies
working-directory: ./backend
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
working-directory: ./backend
run: |
# Add your test command here
pytest
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:
name: Deploy Frontend to GitHub Pages
runs-on: ubuntu-latest
needs: build-frontend
if: github.ref == 'refs/heads/main'

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: develop
folder: frontend/dist

0 comments on commit 84d2676

Please sign in to comment.