Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
4cd5b36
update
Routparesh Oct 12, 2025
da1e3e4
update dockerfile
Routparesh Oct 12, 2025
17ec166
update
Routparesh Oct 13, 2025
6e23de2
update
Routparesh Oct 25, 2025
0ebf083
update
Routparesh Oct 26, 2025
65c693b
update
Routparesh Oct 26, 2025
7ab0dbd
update
Routparesh Oct 26, 2025
80fac3f
update
Routparesh Oct 26, 2025
34a5c2f
update
Routparesh Oct 26, 2025
f5761d1
update
Routparesh Oct 26, 2025
1e3e12d
update
Routparesh Oct 26, 2025
48085c2
update
Routparesh Oct 26, 2025
6b90fed
update
Routparesh Oct 26, 2025
cf4c490
update
Routparesh Oct 26, 2025
a8a1a47
update
Routparesh Oct 26, 2025
d515179
update
Routparesh Oct 26, 2025
12b780c
update
Routparesh Oct 26, 2025
aa59048
update
Routparesh Oct 26, 2025
eefc42f
update
Routparesh Oct 26, 2025
7e5d3f8
update
Routparesh Oct 26, 2025
7cdf764
update
Routparesh Oct 26, 2025
d532983
update
Routparesh Oct 26, 2025
27002ed
update
Routparesh Oct 27, 2025
5000678
update
Routparesh Oct 27, 2025
087ed9b
update
Routparesh Oct 27, 2025
2e26879
update
Routparesh Oct 27, 2025
3ad37ca
Update
Routparesh Oct 27, 2025
161b438
Update
Routparesh Oct 27, 2025
4bc0cb8
Update
Routparesh Oct 27, 2025
dc8520b
Update
Routparesh Oct 27, 2025
dc873d5
update
Routparesh Oct 27, 2025
b0a2f92
update
Routparesh Oct 27, 2025
7f754d5
update
Routparesh Oct 27, 2025
1c87392
update
Routparesh Oct 27, 2025
0d90175
update
Routparesh Oct 27, 2025
33bc576
update
Routparesh Oct 27, 2025
afad4bc
update images to 33bc576d4585f6673ac665ad81ba7c8d42ec3619
github-actions[bot] Oct 27, 2025
cdcc0dc
update k8s
Routparesh Oct 27, 2025
b7c3810
update images to cdcc0dcad33aa757c3d49bdcdbc795548dee47e0
github-actions[bot] Oct 27, 2025
98f6a19
Update chattingo-backend-deployment.yaml
Routparesh Oct 27, 2025
a6d0952
update
Routparesh Oct 27, 2025
0c2898a
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 27, 2025
7cabfac
update
Routparesh Oct 30, 2025
5ea382d
update images to 7cabfacc0550f243faab9d1a59bd9e8b9f5354be
github-actions[bot] Oct 30, 2025
78a2ce3
update
Routparesh Oct 30, 2025
bd1509c
update images to 78a2ce383fdd126feca2ded0a4421f567f258039
github-actions[bot] Oct 30, 2025
af3fb04
update
Routparesh Oct 30, 2025
cd7f33f
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 30, 2025
ecffe30
update
Routparesh Oct 30, 2025
f47ae78
update images to ecffe30e4d35c94d3fcb4438415da4e6bdab6b7c
github-actions[bot] Oct 30, 2025
a623179
update db
Routparesh Oct 30, 2025
9519bc1
update db in env
Routparesh Oct 30, 2025
c378509
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 30, 2025
969aa92
update images to c3785091fc1be8eaa3284730cb4541953c440de1
github-actions[bot] Oct 30, 2025
5fabd61
update probe
Routparesh Oct 30, 2025
72452c8
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 30, 2025
d03b5c2
update images to 72452c8f2ba59698bee6cd0f793fddff5936c463
github-actions[bot] Oct 30, 2025
a86f36b
update sonar
Routparesh Oct 30, 2025
afb75c0
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 30, 2025
03ba45f
update images to afb75c0b9cc2ccf591699eac7dc6a981da125d11
github-actions[bot] Oct 30, 2025
e6d5246
ingress
Routparesh Oct 30, 2025
82fa842
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 30, 2025
df48a2e
update images to 82fa8420fce86795a56e01a0b7cf97ecdc30e628
github-actions[bot] Oct 30, 2025
3375982
update backend
Routparesh Oct 30, 2025
e9c0887
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 30, 2025
7fd472f
update images to e9c0887ba3a614b29db043a3c682010bf2e84254
github-actions[bot] Oct 30, 2025
e52ba00
update db
Routparesh Oct 30, 2025
4194914
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 30, 2025
ebb1658
update images to 419491474988e11ab740168b81a4564acff8d2c0
github-actions[bot] Oct 30, 2025
b7df82b
update
Routparesh Oct 30, 2025
7cc2f1c
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 30, 2025
6dfbdee
update images to 7cc2f1c79dfc2f4fdcc7a6bd0a1e688f41548f2d
github-actions[bot] Oct 30, 2025
1d9bf4e
update
Routparesh Oct 31, 2025
1952921
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 31, 2025
a6dd095
update
Routparesh Oct 31, 2025
7ed9dc2
update images to a6dd095e6a935ecc89f4630b69aa54428b34b63f
github-actions[bot] Oct 31, 2025
f099872
update frontend
Routparesh Oct 31, 2025
dfccc33
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 31, 2025
fbea059
update
Routparesh Oct 31, 2025
0724601
update images to fbea059fdba410d808ddcf947506c7cc26d9f1af
github-actions[bot] Oct 31, 2025
549249c
update
Routparesh Oct 31, 2025
c8e2265
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 31, 2025
01c07af
update
Routparesh Oct 31, 2025
6eaa63a
update images to 01c07af0b9bb95f706e19a151c1915b075fe2f44
github-actions[bot] Oct 31, 2025
89a78ba
update
Routparesh Oct 31, 2025
ec127a1
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 31, 2025
3ab1df3
update images to ec127a1f9ba4e3fcac6ba1c0f2d29752e642d005
github-actions[bot] Oct 31, 2025
b9f0da6
new update
Routparesh Oct 31, 2025
c92f67f
update images to b9f0da66970ce10deb3014b0d64f14582378ecae
github-actions[bot] Oct 31, 2025
677c9ac
delete readness
Routparesh Oct 31, 2025
7cbebb6
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 31, 2025
60d9fa9
delete readness
Routparesh Oct 31, 2025
21a8fb9
update images to 60d9fa9727a5eed0c1d1da19b1d74cd1fe2c63ec
github-actions[bot] Oct 31, 2025
f508f0c
update frontend deployment
Routparesh Oct 31, 2025
8e19a76
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 31, 2025
16f0ffd
update images to 8e19a7637072f749b0a6b770e4c2d52d0e76895e
github-actions[bot] Oct 31, 2025
81f9af5
update ingress
Routparesh Oct 31, 2025
0c2b228
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Oct 31, 2025
acb4475
update images to 0c2b2288b920a63c62a0fb8588e691f29dbe546d
github-actions[bot] Oct 31, 2025
d9c9cc3
update ingress
Routparesh Nov 1, 2025
523082d
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
6d627ee
update images to 523082d8370812dfc632bee2279be1ab05b0336c
github-actions[bot] Nov 1, 2025
b25c922
update
Routparesh Nov 1, 2025
7bef9da
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
6185933
update images to 7bef9daf98ef735ee57477a8f7160bf1edf42da6
github-actions[bot] Nov 1, 2025
7bf8b87
update
Routparesh Nov 1, 2025
9bdbbe2
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
599e73a
update images to 9bdbbe2e64847f3036d95ca5c25b94360a8448fd
github-actions[bot] Nov 1, 2025
c619473
update ingress file
Routparesh Nov 1, 2025
5d74fa7
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
ae5f430
update images to 5d74fa78fc9cd4428190776e464a20515aabda2c
github-actions[bot] Nov 1, 2025
e71b6e7
update
Routparesh Nov 1, 2025
682b358
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
858ff9b
update images to 682b35874d299af33daf790d46d397c25e676a55
github-actions[bot] Nov 1, 2025
bd9c6d2
update
Routparesh Nov 1, 2025
1e84027
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
7b34fca
update
Routparesh Nov 1, 2025
c2dc2aa
update images to 7b34fca3ee4a822bbc868270b33201e84abcb6ca
github-actions[bot] Nov 1, 2025
4c8619c
update
Routparesh Nov 1, 2025
9ed0d65
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
c7540b1
update images to 9ed0d6537c613be77743b455f19dc88850228e16
github-actions[bot] Nov 1, 2025
15c157f
update
Routparesh Nov 1, 2025
0f32290
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
48a5363
update images to 0f3229038bc72b99904dd35cd2ef9c2893cdaa8a
github-actions[bot] Nov 1, 2025
9f55295
update ingress
Routparesh Nov 1, 2025
8f32072
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
6b77b25
update images to 8f320729b4a13ba1fc67c0556d83637162c9a1e5
github-actions[bot] Nov 1, 2025
ba53d5a
update
Routparesh Nov 1, 2025
8e1702f
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
68d559a
update images to 8e1702f69255627cdf6389a1e340488c663af363
github-actions[bot] Nov 1, 2025
f4e2489
update
Routparesh Nov 1, 2025
8b16d67
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
45c90b5
update images to 8b16d67e12f0ea39c82fe72e157a4dbea721773a
github-actions[bot] Nov 1, 2025
df702c2
update
Routparesh Nov 1, 2025
b9f7a01
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
234470d
update images to b9f7a0105b5a36b2017b9b10f5411c8a94597d97
github-actions[bot] Nov 1, 2025
e3945ca
update
Routparesh Nov 1, 2025
e92861b
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
2db4dfb
update images to e92861bbd8fa2734e97899fe616c0250d7c49ded
github-actions[bot] Nov 1, 2025
c08a3e0
update
Routparesh Nov 1, 2025
a3505cf
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
5dff6c5
update images to a3505cf0d5d15ee4fcf48c6d31209178d2b2939f
github-actions[bot] Nov 1, 2025
38c1a80
update
Routparesh Nov 1, 2025
805098d
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
b113291
update images to 805098dfed53ef8349bc4bab41cf516a6c44007f
github-actions[bot] Nov 1, 2025
571a0ad
update
Routparesh Nov 1, 2025
d1f8b88
Merge branch 'docker' of https://github.com/Routparesh/chattingo into…
Routparesh Nov 1, 2025
8e83fdf
update images to d1f8b88c7c26ae078d2ce31e1062b52ae13ab753
github-actions[bot] Nov 1, 2025
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
242 changes: 242 additions & 0 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
name: CI Pipeline

on:
push:
branches: [main, docker]

env:
FRONTEND_IMAGE: routparesh/chattingo-frontend
BACKEND_IMAGE: routparesh/chattingo-backend

jobs:
# ---------------- FRONTEND TEST ----------------
frontend-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18

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

- name: Run frontend tests
working-directory: ./frontend
run: |
if [ -f package.json ] && grep -q "\"test\":" package.json; then
npm test -- --coverage
else
echo "⚠️ No test script found in frontend/package.json"
fi

# ---------------- BACKEND CI (Build + Test + Sonar) ----------------
backend-ci:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: test@123
MYSQL_DATABASE: chattingo_db
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=5

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

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Load backend environment variables
working-directory: ./backend
run: |
echo "SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/chattingo_db" >> $GITHUB_ENV
echo "SPRING_DATASOURCE_USERNAME=root" >> $GITHUB_ENV
echo "SPRING_DATASOURCE_PASSWORD=test@123" >> $GITHUB_ENV
echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> $GITHUB_ENV

- name: Wait for MySQL to be ready
run: |
for i in {1..15}; do
nc -zv 127.0.0.1 3306 && echo "✅ MySQL is ready!" && break
echo "⏳ Waiting for MySQL..."
sleep 5
done

- name: Build and Run Tests
working-directory: ./backend
run: mvn clean verify

- name: SonarQube Analysis
working-directory: ./backend
run: |
mvn sonar:sonar \
-Dsonar.projectKey=chattingo-backend \
-Dsonar.projectName=chattingo-backend \
-Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \
-Dsonar.java.binaries=target/classes

# ---------------- SONAR SCAN (Frontend Only) ----------------
sonar-frontend:
runs-on: ubuntu-latest
needs: [frontend-test, backend-ci]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: SonarQube Scan (frontend)
uses: sonarsource/sonarqube-scan-action@v3
with:
projectBaseDir: ./frontend
args: >
-Dsonar.projectName=chattingo-frontend
-Dsonar.projectKey=chattingo-frontend
-Dsonar.sources=src
-Dsonar.tests=src
-Dsonar.test.inclusions=**/*.test.js,**/*.spec.js
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

# ---------------- SECURITY SCAN ----------------
security-scan:
runs-on: ubuntu-latest
needs: sonar-frontend
steps:
- name: Checkout full history
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run Gitleaks Scan
uses: gitleaks/gitleaks-action@v2
with:
args: detect --source . --no-banner --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18

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

- name: Run npm audit for vulnerabilities
working-directory: ./frontend
run: npm audit --audit-level=low || true

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: OWASP Dependency Check (Backend)
uses: dependency-check/Dependency-Check_Action@main
env:
JAVA_HOME: /opt/jdk
with:
project: chattingo-backend
path: ./backend
format: 'HTML'
out: reports

- name: Upload Dependency Check Report
uses: actions/upload-artifact@v4
with:
name: dependency-check-report
path: reports

- name: Run Trivy Filesystem Scan
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: .
format: 'table'
exit-code: '0'

- name: Build Images for Scanning
run: |
docker build -t frontend-scan ./frontend
docker build -t backend-scan ./backend

- name: Run Trivy Image Scan (Frontend)
uses: aquasecurity/trivy-action@master
with:
image-ref: 'frontend-scan'
format: 'table'
exit-code: '0'

- name: Run Trivy Image Scan (Backend)
uses: aquasecurity/trivy-action@master
with:
image-ref: 'backend-scan'
format: 'table'
exit-code: '0'

# ---------------- DOCKER BUILD & DEPLOY ----------------
docker-deploy:
runs-on: ubuntu-latest
needs: security-scan
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Build and Push Frontend image
working-directory: ./frontend
run: |
FRONTEND_BUILD_ARGS="--build-arg REACT_APP_API_URL=http://chattingo.paresh.work/api"

docker build $FRONTEND_BUILD_ARGS -t ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} .
docker push ${{ env.FRONTEND_IMAGE }}:${{ github.sha }}

- name: Build and Push Backend image
working-directory: ./backend
run: |
docker build -t ${{ env.BACKEND_IMAGE }}:${{ github.sha }} .
docker push ${{ env.BACKEND_IMAGE }}:${{ github.sha }}

- name: Update image tags in Kubernetes manifests
run: |
sed -i "s|routparesh/chattingo-frontend:.*| ${{ env.FRONTEND_IMAGE }}:${{ github.sha }}|g" k8s/chattingo-frontend-deployment.yaml
sed -i "s|routparesh/chattingo-backend:.*| ${{ env.BACKEND_IMAGE }}:${{ github.sha }}|g" k8s/chattingo-backend-deployment.yaml

- name: Commit updated image tags
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add k8s/*.yaml
git commit -m "update images to ${{ github.sha }}"
git push
Loading