-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (32 loc) · 1.01 KB
/
Copy pathdeploy.yml
File metadata and controls
32 lines (32 loc) · 1.01 KB
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
name: Deploy
on: push
jobs:
deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install
run: yarn install
- name: Build server
run: yarn build:server
- name: Build client
run: yarn build:client
- name: Configurate
run: cp ./pm2.config.js ./dist/pm2.config.js
- name: Deploy
uses: burnett01/rsync-deployments@7.0.1
with:
switches: -a --delete --progress
path: dist/
remote_path: ${{ secrets.SSH_REMOTE_DIR }}
remote_host: ${{ secrets.SSH_HOST }}
remote_user: ${{ secrets.SSH_USER }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Restart
uses: JimCronqvist/action-ssh@master
with:
hosts: ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}
privateKey: ${{ secrets.SSH_PRIVATE_KEY }}
command: pm2 restart ${{ secrets.PM2_NAME }}