Bashir Gulistani
commited on
Delete .github/workflows/server_check.yml
Browse files
.github/workflows/server_check.yml
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
name: Server Monitoring and Auto-Recovery
|
2 |
-
|
3 |
-
on:
|
4 |
-
schedule:
|
5 |
-
- cron: "*/30 * * * *"
|
6 |
-
workflow_dispatch:
|
7 |
-
|
8 |
-
jobs:
|
9 |
-
check-server:
|
10 |
-
runs-on: ubuntu-latest
|
11 |
-
|
12 |
-
steps:
|
13 |
-
- name: Setup Secondary SSH Key
|
14 |
-
uses: webfactory/ssh-agent@v0.5.3
|
15 |
-
with:
|
16 |
-
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
17 |
-
|
18 |
-
- name: Store New SSH Key and Public Key in Files
|
19 |
-
run: |
|
20 |
-
echo "${{ secrets.SSH_PRIVATE_KEY }}" > mykey
|
21 |
-
chmod 600 mykey
|
22 |
-
echo "${{ secrets.NEW_SSH_PUBLIC_KEY }}" > mykey.pub
|
23 |
-
|
24 |
-
- name: Store Old SSH Key
|
25 |
-
run: |
|
26 |
-
echo "${{ secrets.SSH_PRIVATE_KEY_STUDENT_GEN }}" > secondary_key
|
27 |
-
chmod 600 secondary_key
|
28 |
-
|
29 |
-
- name: Check and Recover Server
|
30 |
-
run: |
|
31 |
-
PORT=22040
|
32 |
-
MACHINE="paffenroth-23.dyn.wpi.edu"
|
33 |
-
REPO_URL="https://github.com/Bashir1999/products.git"
|
34 |
-
PROJECT_DIR="products"
|
35 |
-
APP_FILE="app.py"
|
36 |
-
|
37 |
-
log() {
|
38 |
-
echo "[INFO] $1"
|
39 |
-
}
|
40 |
-
log "Checking if SSH connection with key works..."
|
41 |
-
ssh -i mykey -p "${PORT}" -o StrictHostKeyChecking=no student-admin@"${MACHINE}"
|
42 |
-
log "SSH connection with key works. Proceeding with the deployment steps."
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|