-
-
Notifications
You must be signed in to change notification settings - Fork 6
175 lines (174 loc) · 7.07 KB
/
deploy_server.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: ☁️ Deploy Microservices
on:
workflow_dispatch:
inputs:
redeploy_all:
type: boolean
default: false
description: Redeploy all (be careful!)
redeploy_tcp_sockets:
type: boolean
default: false
description: TCP Sockets
redeploy_web_sockets:
type: boolean
default: false
description: WebSockets
redeploy_update_server:
type: boolean
default: false
description: Update server (bin list)
redeploy_web_server:
type: boolean
default: false
description: Web server
redeploy_alerts:
type: boolean
default: false
description: Alerts
redeploy_weather:
type: boolean
default: false
description: Weather
redeploy_updater:
type: boolean
default: false
description: Updater
redeploy_svg_generator:
type: boolean
default: false
description: SVG Generator
redeploy_etryvoga:
type: boolean
default: false
description: Etryvoga
run-name: Deploy Microservices from '${{ github.ref_name }}' branch
jobs:
deploy_microservices:
runs-on: ubuntu-latest
steps:
- name: Redeploy TCP Sockets
if: ${{ inputs.redeploy_tcp_sockets || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_tcp_server.sh -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy WebSockets
if: ${{ inputs.redeploy_web_sockets || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_websocket_server.sh -m ${{ secrets.MEMCACHED_HOST }} -s ${{ secrets.API_SECRET }} -i ${{ secrets.MEASUREMENT_ID }}
- name: Redeploy Update Server (bin list)
if: ${{ inputs.redeploy_update_server || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_update_server.sh -s '/root/ukraine_alarm_map/bin' -sb '/root/ukraine_alarm_map/bin_beta' -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Web Server
if: ${{ inputs.redeploy_web_server || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_web_server.sh -d ${{ secrets.WEB_TOKEN }} -p 80 -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Weather
if: ${{ inputs.redeploy_weather || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_weather.sh -w ${{ secrets.WEATHER_TOKEN }} -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Updater
if: ${{ inputs.redeploy_updater || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_updater.sh -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Svg Generator
if: ${{ inputs.redeploy_svg_generator || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_svg_generator.sh -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Etryvoga
if: ${{ inputs.redeploy_etryvoga || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_etryvoga.sh -e ${{ secrets.ETRYVOGA_HOST }} -ed ${{ secrets.ETRYVOGA_DISTRICTS_HOST }} -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Alerts
if: ${{ inputs.redeploy_alerts || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_alerts.sh -a ${{ secrets.AIR_ALARM_API_KEY }} -p 2 -m ${{ secrets.MEMCACHED_HOST }}
- name: Clear unused images
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
docker image prune -f