-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (102 loc) · 3.6 KB
/
Copy pathci-cd.yml
File metadata and controls
125 lines (102 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: EduVox AI - CI/CD Pipeline
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
# 🔍 QUALITY CHECKS
quality-check:
name: Code Quality & Build Check
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout Repository
uses: actions/checkout@v4
- name: 📦 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: 🔧 Install Dependencies
run: npm ci
- name: 🧹 Run ESLint
run: npm run lint
continue-on-error: false
- name: 🔍 TypeScript Type Check
run: npx tsc --noEmit
continue-on-error: false
- name: 🏗️ Build Project
run: npm run build
env:
# Add required environment variables for build
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
NEXT_PUBLIC_VAPI_WEB_TOKEN: ${{ secrets.NEXT_PUBLIC_VAPI_WEB_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: 📊 Build Summary
run: |
echo "✅ Build completed successfully!"
echo "📦 Bundle size information available in build output"
# 🔒 SECURITY AUDIT
security-audit:
name: Security & Dependency Check
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout Repository
uses: actions/checkout@v4
- name: 📦 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: 🔧 Install Dependencies
run: npm ci
- name: 🔒 Security Audit
run: npm audit --audit-level=moderate
continue-on-error: true
- name: 🔍 Check for Outdated Packages
run: npm outdated || true
# 🚀 DEPLOYMENT
deploy:
name: Deploy to Vercel
needs: [quality-check, security-audit]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- name: 📥 Checkout Repository
uses: actions/checkout@v4
- name: 🚀 Deploy to Vercel (Production)
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: "--prod"
working-directory: ./
- name: 📝 Deployment Success Notification
run: |
echo "🎉 EduVox AI deployed successfully to production!"
echo "🌐 URL: https://eduvox-ai.vercel.app"
# 🔄 PREVIEW DEPLOYMENT (for PRs)
preview-deploy:
name: Preview Deployment
needs: [quality-check]
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: 📥 Checkout Repository
uses: actions/checkout@v4
- name: 🔍 Deploy Preview to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./
- name: 📝 Preview URL Comment
run: |
echo "🔍 Preview deployment ready for testing!"
echo "Check the Vercel deployment for preview URL"