Skip to content

chore(*): add pm2 config #17

chore(*): add pm2 config

chore(*): add pm2 config #17

Workflow file for this run

name: Build and deploy
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install
run: yarn install
- name: Build server
run: yarn build:server
- name: Build client
run: yarn build:client
- name: Upload
uses: actions/upload-artifact@v2
with:
name: distribution
path: dist/
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Download
uses: actions/download-artifact@v2
with:
name: distribution
path: dist/
- 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 }}