File tree Expand file tree Collapse file tree 1 file changed +32
-3
lines changed Expand file tree Collapse file tree 1 file changed +32
-3
lines changed Original file line number Diff line number Diff line change 66 - main
77
88jobs :
9- deploy :
9+ ci :
10+ name : Continuous Integration
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout Code
15+ uses : actions/checkout@v3
16+
17+ - name : Install Backend Dependencies
18+ working-directory : ./backend
19+ run : npm install
20+
21+ - name : Install Frontend Dependencies
22+ working-directory : ./frontend
23+ run : npm install
24+
25+ - name : Build Frontend
26+ working-directory : ./frontend
27+ run : npm run build
28+
29+ - name : Check Frontend Build Output
30+ run : |
31+ if [ ! -f frontend/dist/index.html ]; then
32+ echo "❌ Frontend build failed"
33+ exit 1
34+ else
35+ echo "✅ Frontend build succeeded"
36+ fi
37+
38+ cd :
39+ name : Continuous Deployment
40+ needs : ci
1041 runs-on : ubuntu-latest
1142
1243 steps :
69100 echo "🌐 Step 8: Deploy frontend to Nginx root"
70101 sudo rm -rf /opt/day07/*
71102 sudo cp -r /home/hostapp/React-02/frontend/dist/* /opt/day07/
72-
73-
74103
75104 echo "🔁 Step 9: Restart Nginx"
76105 sudo nginx -t
You can’t perform that action at this time.
0 commit comments