-
Notifications
You must be signed in to change notification settings - Fork 15
54 lines (43 loc) · 1.65 KB
/
deploy.yml
File metadata and controls
54 lines (43 loc) · 1.65 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
name: Deploy to Dokku
on:
push:
branches: [master]
jobs:
deploy:
name: Deploy to Production
runs-on: ubuntu-latest
steps:
- name: Deploy to Dokku
run: |
echo "Triggering deployment for commit ${{ github.sha }}"
response=$(curl -s -w "%{http_code}" -o response.json \
-X POST https://server.tooangel.com/deploy/worlddriven-core \
-H "Authorization: Bearer ${{ secrets.DEPLOY_WEBHOOK_SECRET }}" \
-H "Content-Type: application/json" \
-d '{
"repository": "${{ github.repository }}",
"commit": "${{ github.sha }}",
"branch": "${{ github.ref_name }}"
}')
http_code="${response: -3}"
echo "HTTP Status Code: $http_code"
echo "Response:"
cat response.json
if [ "$http_code" -ne 200 ]; then
echo "Deployment failed with HTTP status: $http_code"
exit 1
fi
echo "Deployment triggered successfully!"
- name: Verify Deployment
run: |
echo "Waiting 30 seconds for deployment to complete..."
sleep 30
echo "Checking if worlddriven service is responding..."
response=$(curl -s -w "%{http_code}" -o health.json https://www.worlddriven.org/ || echo "000")
http_code="${response: -3}"
if [ "$http_code" = "200" ]; then
echo "✅ Deployment successful - worlddriven is responding"
else
echo "⚠️ Warning: worlddriven may still be starting (HTTP $http_code)"
echo "This doesn't necessarily mean deployment failed."
fi