-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (33 loc) · 1014 Bytes
/
deploy.yml
File metadata and controls
38 lines (33 loc) · 1014 Bytes
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
name: Deploy to Production Server
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
set -e
cd ~/Sprinkl
echo "🚀 Starting deployment..."
# Run deployment script and capture exit code
if bash scripts/deploy.sh; then
echo "✅ Deployment completed successfully"
else
echo "❌ Deployment failed, initiating rollback..."
if bash scripts/rollback.sh; then
echo "✅ Rollback completed successfully"
else
echo "❌ Rollback also failed - manual intervention required"
exit 1
fi
fi