Skip to content

Commit 6503d18

Browse files
rayhan1967rayhan1967
authored andcommitted
πŸš€ Add CI/CD pipeline and Kubernetes deployment
✨ CI/CD Features: - GitHub Actions workflow for automated testing - Docker image building on push/PR - Automated deployment to Azure Container Instances - Multi-stage pipeline with test and deploy jobs πŸ› οΈ Kubernetes Infrastructure: - User service deployment with 3 replicas - Service discovery with ClusterIP - Environment configuration with secrets - Production-ready scaling configuration πŸ“Š DevOps Excellence: Complete automation and orchestration
1 parent 26c6cc9 commit 6503d18

File tree

16 files changed

+7044
-0
lines changed

16 files changed

+7044
-0
lines changed

β€Ž.github/workflows/ci-cd.ymlβ€Ž

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: '18'
19+
20+
- name: Install dependencies
21+
run: |
22+
npm install --prefix user-service
23+
npm install --prefix product-service
24+
npm install --prefix order-service
25+
npm install --prefix api-gateway
26+
27+
- name: Run tests
28+
run: |
29+
npm test --prefix user-service
30+
npm test --prefix product-service
31+
32+
- name: Build Docker images
33+
run: |
34+
docker build -t user-service:${{ github.sha }} ./user-service
35+
docker build -t product-service:${{ github.sha }} ./product-service
36+
37+
deploy:
38+
needs: test
39+
runs-on: ubuntu-latest
40+
if: github.ref == 'refs/heads/main'
41+
42+
steps:
43+
- name: Deploy to Azure Container Instances
44+
run: |
45+
az container create \
46+
--resource-group microservices-rg \
47+
--name user-service-${{ github.sha }} \
48+
--image user-service:${{ github.sha }}

β€Žapi-gateway/middleware/security.jsβ€Ž

Whitespace-only changes.

0 commit comments

Comments
Β (0)