Skip to content

Commit b5c1810

Browse files
Update deploy.yml
1 parent 2fa0c5e commit b5c1810

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,38 @@ on:
66
- main
77

88
jobs:
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:
@@ -69,8 +100,6 @@ jobs:
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

0 commit comments

Comments
 (0)