-
Notifications
You must be signed in to change notification settings - Fork 57
56 lines (49 loc) · 1.73 KB
/
devnet.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
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Devnet
on: workflow_dispatch
jobs:
devnet:
runs-on: ubuntu-latest
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
steps:
- uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '10.6'
- name: Intall dependencies
run: |
npm ci --no-audit
- name: Build
run: npm run build
- name: rsync code
uses: burnett01/[email protected]
with:
switches: -avzr --delete --include="./"
path: ./
remote_path: ${{ secrets.PATH }}
remote_host: ${{ secrets.HOSTMAINNET }}
remote_port: ${{ secrets.PORT }}
remote_user: ${{ secrets.USERNAME }}
remote_key: ${{ secrets.KEYMAINNET }}
- name: Restart services
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOSTMAINNET }}
port: ${{ secrets.PORT }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEYMAINNET }}
script: |
cd ${{ secrets.PATH }}
bash deploy.sh
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: system-healthcheck
SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
SLACK_ICON_EMOJI: ':tomomaster:'
SLACK_MESSAGE: ' ${{ env.COMMIT_MESSAGE }} :rocket: '
SLACK_USERNAME: tomomaster-deploy-bot
SLACK_WEBHOOK: ${{ secrets.SLACK }}