Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to fix .yml file with aq update #35

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 32 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
name: remote ssh command
name: Execute Remote SSH Commands

on:
push:
branches: [ main ]
jobs:
branches: [main]

build:
name: Build
jobs:
execute-commands:
name: Execute Commands
runs-on: ubuntu-latest

steps:
- name: executing remote ssh commands using password
uses: appleboy/[email protected]
with:
HOST: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
script: |
cd bahja-isaac-nas-discord-chatbot
git pull
npm i
pm2 stop chatbot
pm2 start index.js --name chatbot

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: |
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."