-
-
Notifications
You must be signed in to change notification settings - Fork 2
148 lines (129 loc) · 4.25 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
name: Deploy
on:
release:
types:
- published
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint and Format with Ruff
run: |
pip install ruff
ruff check
ruff format
deploy:
runs-on: ubuntu-latest
needs:
- check
steps:
- name: ZeroTier
uses: zerotier/[email protected]
with:
network_id: ${{ secrets.ZEROTIER_NETWORK_ID }}
auth_token: ${{ secrets.ZEROTIER_CENTRAL_TOKEN }}
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Register Hibonite SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.HIBONITE_SSH_KEY }}
name: id_hibonite
known_hosts: ${{ secrets.HIBONITE_KNOWN_HOSTS }}
if_key_exists: replace
config: |
Host hibonite.gems.teknologiumum.com
HostName hibonite.gems.teknologiumum.com
User ${{ secrets.HIBONITE_SSH_USER }}
Port ${{ secrets.HIBONITE_SSH_PORT }}
IdentityFile ~/.ssh/id_hibonite
ServerAliveInterval 15
- name: Register Tanzanite SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.TANZANITE_SSH_KEY }}
name: id_tanzanite
known_hosts: ${{ secrets.TANZANITE_KNOWN_HOSTS }}
if_key_exists: replace
config: |
Host tanzanite.gems.teknologiumum.com
HostName tanzanite.gems.teknologiumum.com
User ${{ secrets.TANZANITE_SSH_USER }}
Port ${{ secrets.TANZANITE_SSH_PORT }}
IdentityFile ~/.ssh/id_tanzanite
ServerAliveInterval 15
- name: Register Painite SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.PAINITE_SSH_KEY }}
name: id_painite
known_hosts: ${{ secrets.PAINITE_KNOWN_HOSTS }}
if_key_exists: replace
config: |
Host painite.gems.teknologiumum.com
HostName painite.gems.teknologiumum.com
User ${{ secrets.PAINITE_SSH_USER }}
Port ${{ secrets.PAINITE_SSH_PORT }}
IdentityFile ~/.ssh/id_painite
ServerAliveInterval 15
- name: Ping Hibonite Host
shell: bash
run: |
count=120 # 2 minutes
while ! ping -c 1 hibonite.gems.teknologiumum.com ; do
echo "waiting..." ;
sleep 1 ;
let count=count-1
done
if [ $count -eq 0 ]; then
echo "Failed to ping hibonite.gems.teknologiumum.com"
exit 1
fi
- name: Ping Tanzanite Host
shell: bash
run: |
count=120 # 2 minutes
while ! ping -c 1 tanzanite.gems.teknologiumum.com ; do
echo "waiting..." ;
sleep 1 ;
let count=count-1
done
if [ $count -eq 0 ]; then
echo "Failed to ping tanzanite.gems.teknologiumum.com"
exit 1
fi
- name: Ping Painite Host
shell: bash
run: |
count=120 # 2 minutes
while ! ping -c 1 painite.gems.teknologiumum.com ; do
echo "waiting..." ;
sleep 1 ;
let count=count-1
done
if [ $count -eq 0 ]; then
echo "Failed to ping painite.gems.teknologiumum.com"
exit 1
fi
- name: Execute setup file
run: python3 ./setup.py
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
TANZANITE_SUDO_PASSWORD: ${{ secrets.TANZANITE_SUDO_PASSWORD }}
PAINITE_SUDO_PASSWORD: ${{ secrets.PAINITE_SUDO_PASSWORD }}
HIBONITE_SUDO_PASSWORD: ${{ secrets.HIBONITE_SUDO_PASSWORD }}