-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (26 loc) · 779 Bytes
/
deploy.yml
File metadata and controls
30 lines (26 loc) · 779 Bytes
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
name: Deploy Node.js App
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Deploy to server via SSH
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: 22
script: |
cd /opt/projects/100days
git reset --hard
git clean -fd
git pull origin main || git pull git@github.com:interfinityOfficial/100DaysOfWebComponents.git 100days
cd /opt/projects/100days
npm install --production
pm2 reload 100days || pm2 start ecosystem.config.js --env production