Skip to content

Update main.yml

Update main.yml #28

Workflow file for this run

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