-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (41 loc) · 1.44 KB
/
action.yaml
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
name: ChainX Explorer Deployment
# Run this workflow every time a new commit pushed to your repository
on: [push, pull_request]
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
chainx2-scan-deploy:
# Name the Job
name: Deploy chainx2-scan
# Set the type of machine to run on
runs-on: ubuntu-latest
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
# - name: Checkout code
# uses: actions/checkout@v2
- name: Execute SSH commmands on remote server
uses: JimCronqvist/action-ssh@master
env:
NAME: "Root"
BRANCH: "develop"
with:
hosts: '[email protected]'
privateKey: ${{ secrets.PRIVATE_KEY }}
debug: false
command: |
ls -lah
echo "I am $NAME"
pm2 status
free
cd chainx2-scan
git checkout -b server-temp
git checkout develop
eval $(ssh-agent)
ssh-add ~/.ssh/chainx2scan_rsa
git pull
cd packages
git diff --quiet HEAD server-temp -- scan || pm2 restart scan
# git diff --quiet HEAD server-temp -- server || pm2 restart server && pm2 restart server-2 && pm2 restart server-3
git diff --quiet HEAD server-temp -- site || pm2 restart site
git branch -d server-temp
pm2 status