-
Notifications
You must be signed in to change notification settings - Fork 12
92 lines (83 loc) · 2.36 KB
/
deploy-aws-us.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
name: deploy-aws-us
on:
push:
branches: [ main ]
# pull_request:
# types:
# closed
# branches:
# - 'main'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/upload-artifact@v3
with:
name: mydist
path: './*'
deploy-aws-us:
needs: build
runs-on: ubuntu-latest
steps:
- name: download artifact
uses: actions/download-artifact@v3
with:
name: mydist
path: mydist
- name: deploy to remote server [54.84.46.117]
uses: easingthemes/ssh-deploy@v2.2.11
with:
# 服务器私钥
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY_PROD_01 }}
# Server IP
REMOTE_HOST: 54.84.46.117
# Username
REMOTE_USER: root
# Port
REMOTE_PORT: 60022
# Source Path
SOURCE: "mydist/"
# Target Path
TARGET: "/data/web/indexer-helper"
# rsync
ARGS: "-rltgoDzvO"
# An array of folder to exclude
EXCLUDE: ".git, .github"
- name: Execute SSH commmands on remote server[54.84.46.117]
uses: appleboy/ssh-action@master
with:
host: 54.84.46.117
username: root
key: ${{ secrets.SSH_PRIVATE_KEY_PROD_01 }}
port: 60022
script: |
sh /data/web/indexer-helper/boot.sh restart
- name: deploy to remote server [18.207.83.196]
uses: easingthemes/ssh-deploy@v2.2.11
with:
# Private Key
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY_PROD_02 }}
# Server IP
REMOTE_HOST: 18.207.83.196
# Useranme
REMOTE_USER: root
# Port
REMOTE_PORT: 60022
# Source Path
SOURCE: "mydist/"
# Target Path
TARGET: "/data/web/indexer-helper"
# rsync
ARGS: "-rltgoDzvO"
# An array of folder to exclude
EXCLUDE: ".git, .github"
- name: Execute SSH commmands on remote server [18.207.83.196]
uses: appleboy/ssh-action@master
with:
host: 18.207.83.196
username: root
key: ${{ secrets.SSH_PRIVATE_KEY_PROD_02 }}
port: 60022
script: |
sh /data/web/indexer-helper/boot.sh restart