Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Backend CI/CD Pipeline

on:
push:
branches:
- main
paths:
- "backend/**"

pull_request:
branches:
- main
paths:
- "backend/**"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up node.js
uses: actions/setup-node@v4

- name: Install Dependencies
working-directory: ./backend
run: npm install

- name: Code linting
working-directory: ./frontend
run: npm run lint

- name: Build Code
working-directory: ./frontend
run: npm run build

- name: Upload built backend (artifact)
uses: actions/upload-artifact@v4
with:
name: backend-dist
path: backend/dist

deploy:
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Download backend build artifact
uses: actions/download-artifact@v4
with:
name: backend-dist
path: backend/dist

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push Docker Image
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--file backend/Dockerfile \
-t ${{ secrets.DOCKERHUB_USERNAME }}/transyobe-backend:latest \
--push \
backend

- name: Deployment confirmation
run: echo "Backend image pushed to Docker Hub successfully."









78 changes: 78 additions & 0 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Frontend CI/CD

on:
push:
branches:
- main
paths:
- "frontend/**"
pull_request:
branches:
- main
paths:
- "frontend/**"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set Up Node.js
uses: actions/stepup-node@v4
with:
node-version: '20'

- name: Install dependencies
working-directory: ./frontend
run: npm install

- name: Code linting
working-directory: ./frontend
run: npm run lint

- name: Build Code
env:
VITE_API_URL: ${{secrets.VITE_API_URL}}
working-directory: ./frontend
run: npm run build

- name: Upload built frontend (artifact)
uses: actions/upload-artifact@v4
with:
name: frontend-dist
path: frontend/dist

deploy:
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push Docker Image
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--file frontend/Dockerfile \
-t ${{ secrets.DOCKERHUB_USERNAME }}/transyobe_frontend:latest \
--push \
--build-arg VITE_API_URL="${{ secrets.VITE_API_URL }}" \
frontend

- name: Successfully Deployed
run: echo "Frontend image pushed to Docker Hub successfully."


9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ AI assistant that comprehends the video’s content — all within an elegant da
- RAPIDAPI_KEY="your_rapidapi_key"
```

- Run the application:
**Run the application:**

```bash
- npm run dev
- Access the app at http://localhost:3000
- docker compose pull
- docker compose up -d
- http://localhost:5173
- http://localhost:8000
```

⭐ Star this repository if TransYobe helped you explore YouTube videos smarter with AI!
3 changes: 0 additions & 3 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ FROM node:20-alpine AS build
WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build


Expand All @@ -16,7 +14,6 @@ FROM node:20-alpine
WORKDIR /app

COPY package*.json ./

RUN npm install

COPY --from=build /app/dist ./dist
Expand Down
16 changes: 4 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@ version: "3.9"

services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_URL: "http://localhost:8000/api/v1"
image: yash4256/transyobe_frontend:latest
container_name: frontend-transyobe
restart: unless-stopped
ports:
- "5173:80"
networks:
- app-network

environment:
- VITE_API_URL=http://backend:8000/api/v1
depends_on:
- backend

backend:
build:
context: ./backend
dockerfile: Dockerfile
image: yash4256/transyobe-backend:latest
container_name: backend-transyobe
restart: unless-stopped
ports:
Expand All @@ -31,9 +26,6 @@ services:
- app-network
depends_on:
- mongo
volumes:
- ./backend:/app
- /app/node_modules

mongo:
image: mongo:7.0
Expand Down
2 changes: 0 additions & 2 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ COPY . .
ARG VITE_API_URL
ENV VITE_API_URL=${VITE_API_URL}

RUN echo "Building frontend with API_URL=${VITE_API_URL}"

RUN npm run build


Expand Down
Loading