-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.07 KB
/
deploy.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
name: Deploy
on:
push:
branches: [master]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Yarn it!
run: |
yarn install
yarn build
- name: Deploy
uses: appleboy/scp-action@master
with:
host: '${{ secrets.HOST }}'
username: root
key: ${{ secrets.SSH_PRIVATE_KEY }}
source: 'package.json,yarn.lock,dist/**'
target: '/var/www/node/hip2.sinpapeles'
- name: Restart
uses: appleboy/ssh-action@master
with:
host: '${{ secrets.HOST }}'
username: root
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
yarn --cwd /var/www/node/hip2.sinpapeles install --production
service hip2.sinpapeles restart