fix deploy.yml #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Backend CI/CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Deploy Node.js Application | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- name: executing remote ssh commands using password | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
port: ${{ secrets.PORT }} | |
script: | | |
whoami | |
script: | | |
whoami | |
cd /root/312TEN034-backend | |
git pull origin main | |
ln -s /root/.nvm/nvm.sh /root/nvm.sh | |
source /root/nvm.sh | |
nvm install v16.20.2 | |
nvm use v16.20.2 | |
npm install --force | |
pm2 restart 0 |