-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (71 loc) · 2.32 KB
/
deploy.yml
File metadata and controls
80 lines (71 loc) · 2.32 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
name: Deploy Docs to Production
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy-backup:
runs-on: [self-hosted, backup]
name: Deploy to Backup Server
steps:
- name: Deploy Docs to Backup
run: |
echo "Starting docs deployment to BACKUP server..."
/opt/Lokus-Prod/scripts/deploy-docs.sh
echo "Backup deployment complete!"
- name: Health Check
run: |
echo "Running health check..."
sleep 10
if curl -sf http://localhost:3001 > /dev/null; then
echo "Health check passed!"
else
echo "Health check failed!"
exit 1
fi
- name: Discord Notification (Backup)
if: failure()
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
status: failure
title: "Docs Deploy FAILED on Backup"
description: |
Deploy stopped! Production server NOT updated.
Commit: ${{ github.sha }}
By: ${{ github.actor }}
url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
deploy-production:
needs: deploy-backup
runs-on: [self-hosted, production]
name: Deploy to Production Server
steps:
- name: Deploy Docs to Production
run: |
echo "Starting docs deployment to PRODUCTION server..."
/opt/Lokus-Prod/scripts/deploy-docs.sh
echo "Production deployment complete!"
- name: Health Check
run: |
echo "Running health check..."
sleep 10
if curl -sf http://localhost:3001 > /dev/null; then
echo "Health check passed!"
else
echo "Health check failed!"
exit 1
fi
- name: Discord Notification
if: always()
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ job.status }}
title: "Docs Deployment"
description: |
Deployed to both servers
Commit: ${{ github.sha }}
Branch: ${{ github.ref_name }}
By: ${{ github.actor }}
url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}