Inder-26 commited on
Commit
8eae904
·
1 Parent(s): 137da8f

chore: remove unused file

Browse files
Files changed (1) hide show
  1. .github/workflows/main.yaml +0 -108
.github/workflows/main.yaml DELETED
@@ -1,108 +0,0 @@
1
- name: workflow
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- paths-ignore:
8
- - "README.md"
9
-
10
- permissions:
11
- id-token: write
12
- contents: read
13
-
14
- jobs:
15
- integration:
16
- name: Continuous Integration
17
- runs-on: ubuntu-latest
18
-
19
- steps:
20
- - name: Checkout Code
21
- uses: actions/checkout@v3
22
-
23
- - name: Lint code
24
- run: echo "Linting repository"
25
-
26
- - name: Run unit tests
27
- run: echo "Running unit tests"
28
-
29
- build-and-push-ecr-image:
30
- name: Continuous Delivery
31
- needs: integration
32
- runs-on: ubuntu-latest
33
-
34
- steps:
35
- - name: Checkout Code
36
- uses: actions/checkout@v3
37
-
38
- - name: Install Utilities
39
- run: |
40
- sudo apt-get update
41
- sudo apt-get install -y jq unzip
42
-
43
- - name: Configure AWS credentials (OIDC)
44
- uses: aws-actions/configure-aws-credentials@v4
45
- with:
46
- role-to-assume: arn:aws:iam::184619417516:role/GitHubRunnerEC2Role
47
- aws-region: ${{ secrets.AWS_REGION }}
48
-
49
- - name: Login to Amazon ECR
50
- id: login-ecr
51
- uses: aws-actions/amazon-ecr-login@v1
52
-
53
- - name: Build, tag, and push image to Amazon ECR
54
- env:
55
- ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
56
- ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY_NAME }}
57
- IMAGE_TAG: latest
58
- run: |
59
- docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
60
- docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
61
-
62
- Continuous-Deployment:
63
- needs: build-and-push-ecr-image
64
- runs-on: self-hosted
65
-
66
- steps:
67
- - name: Checkout Code
68
- uses: actions/checkout@v3
69
-
70
- - name: Configure AWS credentials
71
- uses: aws-actions/configure-aws-credentials@v4
72
- with:
73
- aws-region: us-east-1
74
-
75
- - name: Login to Amazon ECR
76
- id: login-ecr
77
- uses: aws-actions/amazon-ecr-login@v1
78
-
79
- - name: HARSH Cleanup (Free Disk Space)
80
- run: |
81
- docker system prune -a -f --volumes || true
82
- docker volume prune -f || true
83
- docker container prune -f || true
84
- docker image prune -a -f || true
85
- df -h
86
-
87
- - name: Deploy NetworkSecurity API
88
- run: |
89
- # Stop old container
90
- docker stop networksecurity || true
91
- docker rm networksecurity || true
92
-
93
- # Deploy new container
94
- docker run -d -p 8080:8080 --name=networksecurity \
95
- --restart unless-stopped \
96
- ${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_NAME }}:latest
97
-
98
- # Health check
99
- sleep 30
100
- docker ps
101
- curl -f http://localhost:8080/ || exit 1
102
- echo "✅ Homepage OK"
103
- curl -f http://localhost:8080/predict || exit 1
104
- echo "✅ Predict endpoint OK"
105
- curl -f http://localhost:8080/train || exit 1
106
- echo "✅ Train endpoint OK (CSV fallback)"
107
- echo "🌐 Live at: http://$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4):8080/"
108
- echo "✅ PRODUCTION ML API FULLY DEPLOYED!"