-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (40 loc) · 1.14 KB
/
release.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
name: autoDeploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PWD }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ${{ secrets.SSH_REPOSITORY }}
git fetch --all
git reset --hard origin/main
cd ./domain
npm run build
cd ../client
npm install
rm -rf build
npm run deploy
cd ../server
npm install
pm2 kill
rm -rf build
npm run deploy
- name: send result to slack
uses: 8398a7/action-slack@v3
with:
status: ${{job.status}}
fields: repo,message,commit,author,action,took
author_name: testRepo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}