Update main.yml #30
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: [yml-update] | ||
jobs: | ||
execute-commands: | ||
name: Execute Commands | ||
runs-on: ubuntu-latest | ||
steps: | ||
name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
name: Execute SSH Commands | ||
uses: appleboy/[email protected] | ||
with: | ||
HOST: ${{ secrets.HOST }} | ||
USERNAME: ${{ secrets.USERNAME }} | ||
PASSWORD: ${{ secrets.PASSWORD }} | ||
script: | | ||
cd bahja-isaac-nas-discord-chatbot | ||
# echo "Starting script execution..." | ||
# if [ -d "bahja-isaac-nas-discord-chatbot" ]; then | ||
# cd bahja-isaac-nas-discord-chatbot || exit 1 | ||
# else | ||
# echo "Error: Directory 'bahja-isaac-nas-discord-chatbot' not found." | ||
# exit 1 | ||
# fi | ||
git pull | ||
npm install | ||
pm2 stop chatbot | ||
pm2 start index.js --name chatbot | ||
echo "Script execution completed successfully." |