-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (51 loc) · 1.35 KB
/
build.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
name: Build Songify
on:
push:
branches:
- master
paths-ignore:
- '*.md'
jobs:
prepare:
runs-on: ubuntu-latest
if: "! contains(github.event.head_commit.message, '[skip ci]')"
steps:
- run: echo "${{ github.event.head_commit.message }}"
build:
needs: prepare
name: check for release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.TOKEN }}
- name: Set Node.js 12.14.1
uses: actions/setup-node@v1
with:
node-version: 12.14.1
- name: install dependencies
run: yarn install
env:
NODE_ENV: production
- name: deploy files on server
uses: burnett01/rsync-deployments@4.0
with:
switches: -avzr
path: "./"
remote_path: "/var/www/slackify"
remote_host: ${{ secrets.HOST }}
remote_user: ${{ secrets.SSH_USER }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: restart server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
proxy_key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
su root
. /root/.nvm/nvm.sh
nvm use 12.14.1
pm2 restart Songify.io --update-env