Update main.yml #28
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: Execute Remote SSH Commands | |
on: | |
push: | |
branches: [main] | |
jobs: | |
execute-commands: | |
name: Execute Commands | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# with: | |
# path: bahja-isaac-nas-discord-chatbot | |
- name: Debugging - List Contents of Current Directory | |
run: ls -la | |
- name: Debugging - Print Working Directory | |
run: pwd | |
- name: Execute SSH Commands | |
uses: appleboy/[email protected] | |
with: | |
HOST: ${{ secrets.HOST }} | |
USERNAME: ${{ secrets.USERNAME }} | |
PASSWORD: ${{ secrets.PASSWORD }} | |
script: | | |
cd /home/runner/work/bahja-isaac-nas-discord-chatbot/bahja-isaac-nas-discord-chatbot || exit 1 | |
# Pull latest changes from Git | |
git pull | |
# Install npm dependencies | |
npm install | |
# Stop chatbot if running | |
pm2 stop chatbot | |
# Start chatbot | |
pm2 start index.js --name chatbot | |