-
Notifications
You must be signed in to change notification settings - Fork 438
207 lines (188 loc) · 7.11 KB
/
deploy.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: Deploy
concurrency:
group: deploy
on:
workflow_dispatch:
inputs:
ci_required:
description: 'CI Suite is required'
type: boolean
required: true
default: true
perform_deploy_main:
description: 'Deploy Paradise Main/Secondary'
type: boolean
required: true
default: true
perform_deploy_vega:
description: 'Deploy Paradise Vega'
type: boolean
required: true
default: true
perform_deploy_cleo:
description: 'Deploy Paradise Cleo'
type: boolean
required: true
default: true
perform_deploy_prime:
description: 'Deploy Paradise Prime'
type: boolean
required: true
default: true
perform_deploy_wl:
description: 'Deploy Paradise WL'
type: boolean
required: true
default: true
perform_deploy_tutorial:
description: 'Deploy Paradise Tutorial'
type: boolean
required: true
default: true
# perform_deploy_test:
# description: 'Deploy Paradise Test'
# type: boolean
# required: true
# default: true
jobs:
CI:
uses: ./.github/workflows/ci.yml # use the callable tests job to run tests
if: ${{ inputs.ci_required }}
update-isp-lists:
name: Update ISP Lists
runs-on: ubuntu-latest
steps:
- name: Update ISP Lists
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USERNAME }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
passphrase: ${{ secrets.PRODUCTION_SSH_KEY_PASS }}
script: /var/lib/byond/update_isp_lists.sh
deploy-main:
name: Deploy Paradise Main/Secondary
runs-on: ubuntu-latest
needs: [update-isp-lists, CI]
if: always() && !cancelled() && !failure() && inputs.perform_deploy_main
steps:
- name: Update and Build Paradise Main/Secondary
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USERNAME }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
passphrase: ${{ secrets.PRODUCTION_SSH_KEY_PASS }}
script: |
TIME=$(date +'%Y-%m-%d%T')
sudo systemctl --wait start deploy-main
journalctl --since $TIME -u deploy-main --no-pager --all
systemctl is-failed deploy-main | grep -q "failed" && echo "Deployment Failed!" && exit 1 || exit 0
deploy-vega:
name: Deploy Paradise Vega
runs-on: ubuntu-latest
needs: [update-isp-lists, CI]
if: always() && !cancelled() && !failure() && inputs.perform_deploy_vega
steps:
- name: Update and Build Paradise Vega
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USERNAME }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
passphrase: ${{ secrets.PRODUCTION_SSH_KEY_PASS }}
script: |
TIME=$(date +'%Y-%m-%d%T')
sudo systemctl --wait start deploy-vega
journalctl --since $TIME -u deploy-vega --no-pager --all
systemctl is-failed deploy-vega | grep -q "failed" && echo "Deployment Failed!" && exit 1 || exit 0
deploy-cleo:
name: Deploy Paradise Cleo
runs-on: ubuntu-latest
needs: [update-isp-lists, CI]
if: always() && !cancelled() && !failure() && inputs.perform_deploy_cleo
steps:
- name: Update and Build Paradise Cleo
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USERNAME }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
passphrase: ${{ secrets.PRODUCTION_SSH_KEY_PASS }}
script: |
TIME=$(date +'%Y-%m-%d%T')
sudo systemctl --wait start deploy-cleo
journalctl --since $TIME -u deploy-cleo --no-pager --all
systemctl is-failed deploy-cleo | grep -q "failed" && echo "Deployment Failed!" && exit 1 || exit 0
deploy-prime:
name: Deploy Paradise Prime
runs-on: ubuntu-latest
needs: [update-isp-lists, CI]
if: always() && !cancelled() && !failure() && inputs.perform_deploy_prime
steps:
- name: Update and Build Paradise Prime
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USERNAME }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
passphrase: ${{ secrets.PRODUCTION_SSH_KEY_PASS }}
script: |
TIME=$(date +'%Y-%m-%d%T')
sudo systemctl --wait start deploy-prime
journalctl --since $TIME -u deploy-prime --no-pager --all
systemctl is-failed deploy-prime | grep -q "failed" && echo "Deployment Failed!" && exit 1 || exit 0
deploy-wl:
name: Deploy Paradise WL
runs-on: ubuntu-latest
needs: [update-isp-lists, CI]
if: always() && !cancelled() && !failure() && inputs.perform_deploy_wl
steps:
- name: Update and Build Paradise WL
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USERNAME }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
passphrase: ${{ secrets.PRODUCTION_SSH_KEY_PASS }}
script: |
TIME=$(date +'%Y-%m-%d%T')
sudo systemctl --wait start deploy-wl
journalctl --since $TIME -u deploy-wl --no-pager --all
systemctl is-failed deploy-wl | grep -q "failed" && echo "Deployment Failed!" && exit 1 || exit 0
deploy-tutorial:
name: Deploy Paradise Tutorial
runs-on: ubuntu-latest
needs: [update-isp-lists, CI]
if: always() && !cancelled() && !failure() && inputs.perform_deploy_tutorial
steps:
- name: Update and Build Paradise Tutorial
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USERNAME }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
passphrase: ${{ secrets.PRODUCTION_SSH_KEY_PASS }}
script: |
TIME=$(date +'%Y-%m-%d%T')
sudo systemctl --wait start deploy-tutorial
journalctl --since $TIME -u deploy-tutorial --no-pager --all
systemctl is-failed deploy-tutorial | grep -q "failed" && echo "Deployment Failed!" && exit 1 || exit 0
# deploy-test:
# name: Deploy Paradise Test
# runs-on: ubuntu-latest
# needs: [update-isp-lists, CI]
# if: always() && !cancelled() && !failure() && inputs.perform_deploy_test
# steps:
# - name: Update and Build Paradise Test
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.PRODUCTION_HOST }}
# username: ${{ secrets.PRODUCTION_USERNAME }}
# key: ${{ secrets.PRODUCTION_SSH_KEY }}
# passphrase: ${{ secrets.PRODUCTION_SSH_KEY_PASS }}
# script: |
# TIME=$(date +'%Y-%m-%d%T')
# sudo systemctl --wait start deploy-test
# journalctl --since $TIME -u deploy-test --no-pager --all
# systemctl is-failed deploy-test | grep -q "failed" && echo "Deployment Failed!" && exit 1 || exit 0