Skip to content

Commit

Permalink
update action to install modules on server and reload pm2
Browse files Browse the repository at this point in the history
  • Loading branch information
jaycoolslm committed Jul 6, 2024
1 parent 86471aa commit 5c974e4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/prod-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main

jobs:
production:
runs-on: ubuntu-latest
Expand All @@ -25,7 +26,13 @@ jobs:
chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa.pub
ssh-keyscan -H ${{ secrets.SSH_IP }} >> ~/.ssh/known_hosts
- name: copy builds to server
- name: Copy builds to server
run: |
rsync -vrm dist package.json package-lock.json ${{ secrets.SSH_USER }}@${{ secrets.SSH_IP }}:/var/www/test-api.gomint.me/
- name: Install dependencies on server and reload pm2
run: |
rsync -vrm dist node_modules package.json package-lock.json ${{ secrets.SSH_USER }}@${{ secrets.SSH_IP }}:/var/www/test-api.gomint.me/
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_IP }} "pm2 restart 0"
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_IP }} << 'EOF'
cd /var/www/test-api.gomint.me/
npm ci
pm2 reload 0
EOF

0 comments on commit 5c974e4

Please sign in to comment.