-
Notifications
You must be signed in to change notification settings - Fork 71
67 lines (58 loc) · 2.08 KB
/
deploy.yml
File metadata and controls
67 lines (58 loc) · 2.08 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
name: deploy
on:
workflow_dispatch:
inputs:
github_access_token:
description: 'github access token'
required: true
type: string
env:
ADMIN_GITHUB_TOKEN: ${{ inputs.github_access_token }}
jobs:
download:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Set timezone to Asia/Shanghai
run: |
sudo timedatectl set-timezone Asia/Shanghai
date
- name: Checkout spark-yun-vip
uses: actions/checkout@v4
with:
token: ${{ env.ADMIN_GITHUB_TOKEN }}
repository: "isxcode/spark-yun-vip"
ref: 'main'
- name: Deploy zhiqingyun
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script_stop: true
timeout: 1800s
script: |
rm -rf /tmp/zhiqingyun.tar.gz
jps | grep zhiqingyun.jar | awk '{print $1}' | xargs -r kill -9
cp /data/file/zhiqingyun.tar.gz /tmp/zhiqingyun.tar.gz
tar -vzxf /tmp/zhiqingyun.tar.gz -C /opt/
rm -rf /tmp/zhiqingyun.tar.gz
if [ -d "/opt/zhiqingyun/resources_back" ]; then
rm -rf /opt/zhiqingyun/resources
mv /opt/zhiqingyun/resources_back /opt/zhiqingyun/resources
fi
rm -rf /opt/zhiqingyun/conf/application-local.yml
cp /root/application-local.yml /opt/zhiqingyun/conf/application-local.yml
cp -r /opt/zhiqingyun/resources /opt/zhiqingyun/resources_bak/resources_$(date +'%Y-%m-%d-%H-%M-%S')_bak
rm -rf /tmp/libprql_*
rm -rf /tmp/tomcat.8080.*
rm -rf /tmp/tomcat-docbase.8080.*
bash /opt/zhiqingyun/bin/start.sh --print-log=false
sleep 120
until curl -s https://zhiqingyun-demo.isxcode.com/tools/open/health | grep "UP"; do
echo "Waiting for service to be available..."
sleep 1
done