Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
TrinitroToluen0 committed Sep 22, 2024
1 parent 7d5bdae commit 58187a2
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,22 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Deploy to VPS
uses: appleboy/ssh-action@master
- name: Install SSH key
uses: webfactory/ssh-[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Add server to known hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan -H ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts
- name: Deploy to VPS
run: |
ssh ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }} << 'EOF'
cd ${{ secrets.PROJECT_PATH }}
git pull origin main
npm install
npm run build
pm2 restart all
EOF

0 comments on commit 58187a2

Please sign in to comment.