From a2e344f010ed4e2b108304b97d4726faa7d566a8 Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Mon, 6 Feb 2023 22:52:05 +0200
Subject: [PATCH 01/18] Update index.md
---
docs/files/index.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/files/index.md b/docs/files/index.md
index af71cbe..98ca60d 100644
--- a/docs/files/index.md
+++ b/docs/files/index.md
@@ -19,10 +19,11 @@ Here you can have the syntax menu, but also read some information for nerds.
### Credits
All jokes and videos are accumulated and edited by Lucy Joshua, except:
+
- "I'm From Bat Yam" - Aviv Yashar (@aviv_yashar)
- "Gebels" - Aviv Yashar (@aviv_yashar)
- "Vodka Redbull/Misadot" - Lindi (@lindi_orginal)
- "Misadot Re-enactment" - Kai Mairone (@KaiMairone)
### License
-The project is protected under the GNU GPLv3. For more information, visit the [license page](license.md).
Please read if you conside contributing.
\ No newline at end of file
+The project is protected under the GNU GPLv3. For more information, visit the [license page](license.md).
Please read if you conside contributing.
From 080378254227ced5fd184554456353e3a623a23f Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Mon, 6 Feb 2023 23:02:29 +0200
Subject: [PATCH 02/18] Update usage.md
---
docs/files/usage.md | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/docs/files/usage.md b/docs/files/usage.md
index 665e744..a2b04fa 100644
--- a/docs/files/usage.md
+++ b/docs/files/usage.md
@@ -19,6 +19,7 @@ Victims
If you're included in the victims list, a random number generator will decide if an automated response will be posted, with an additional message.
The victims currently are:
+
- Lucy Joshua (@LucyBscalE)
- Stav Raz (@StevenRaz5)
- Aviv Yashar (@aviv_yashar)
@@ -27,14 +28,17 @@ The victims currently are:
- Shauli Greenfeld (@shaulig)
- Nir Hauschner (@nir_hau)
+
!! note "Join the victim list!"
Wanna be a part of the list? Ask us in our DMs and you'll get there!
The optional responses added to the post:
+
- "שלום קורבן"
- "אי אפשר לברוח מהחרא הזה אה"
- "מה קורה כפרה"
+
For example:
@@ -188,4 +192,4 @@ None
**The possible replies**:
-
\ No newline at end of file
+
From eaaf281a8a799d74f479830ab64a0a747df65b62 Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Mon, 6 Feb 2023 23:05:03 +0200
Subject: [PATCH 03/18] Update usage.md
---
docs/files/usage.md | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/docs/files/usage.md b/docs/files/usage.md
index a2b04fa..a7a9067 100644
--- a/docs/files/usage.md
+++ b/docs/files/usage.md
@@ -29,8 +29,8 @@ The victims currently are:
- Nir Hauschner (@nir_hau)
-!! note "Join the victim list!"
- Wanna be a part of the list? Ask us in our DMs and you'll get there!
+!!! note "Join the victim list!"
+ Wanna be a part of the list? Ask us in our DMs and you'll get there!
The optional responses added to the post:
@@ -188,7 +188,11 @@ None
```
!!! note
- Yep. That's right.
If you'll tag `@FromBotYam` with nothing on, you'll get the tilt gag.
You have been warned.
+ Yep. That's right.
+
+ If you'll tag `@FromBotYam` with nothing on, you'll get the tilt gag.
+
+ You have been warned.
**The possible replies**:
From 6d899d5826a78041530374751bd34ac15b86b7e5 Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Mon, 6 Feb 2023 23:05:28 +0200
Subject: [PATCH 04/18] Update index.md
---
docs/files/index.md | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/docs/files/index.md b/docs/files/index.md
index 98ca60d..028567a 100644
--- a/docs/files/index.md
+++ b/docs/files/index.md
@@ -3,7 +3,11 @@
Welcome to the Bot Yam documentation, to ultimate source of knowledge when it comes about the bot, using the handle @FromBotYam.
!!! warning "Twitter API License Changes"
- Currently, the bot is operating under the Twitter API Elevated Access.
On February 9th, new changes for the API access that has been announced will come into effect, and currently there isn't a guarantee that the bot will be up after the changes will be applied.
+ Currently, the bot is operating under the Twitter API Elevated Access.
+
+ On February 9th, new changes for the API access that has been announced will come into effect, and currently there isn't a guarantee that the bot will be up after the changes will be applied.
+
+
Please follow `@FromBotYam` for updates.
Here you can have the syntax menu, but also read some information for nerds.
From e1a7247c2a2cd73a87ea86edd96fabf017fd2bed Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Mon, 6 Feb 2023 23:05:47 +0200
Subject: [PATCH 05/18] Update data.md
---
docs/files/data.md | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/docs/files/data.md b/docs/files/data.md
index 38ed835..3f0c5b2 100644
--- a/docs/files/data.md
+++ b/docs/files/data.md
@@ -16,7 +16,11 @@ The DB is used for storing everything in stores, as its credentials are currentl
The API tokens are stored in the API hash, used to communicate with Twitter API.
!!! warning "Twitter API License Changes"
- Currently, the bot is operating under the Twitter API Elevated Access.
On February 9th, new changes for the API access that has been announced will come into effect, and currently there isn't a guarantee that the bot will be up after the changes will be applied.
+ Currently, the bot is operating under the Twitter API Elevated Access.
+
+ On February 9th, new changes for the API access that has been announced will come into effect, and currently there isn't a guarantee that the bot will be up after the changes will be applied.
+
+
Please follow `@FromBotYam` for updates.
## The Data Structure
From 46fe0966ecddb77e31a9614f2e72bbd84652b1b5 Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 00:22:15 +0200
Subject: [PATCH 06/18] Error handling (#4)
* Update BotYamPoster.py
Error handler
* Update main.py
---
src/BotYamPoster.py | 29 ++++++++++++++++++++++-------
src/main.py | 2 +-
2 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/src/BotYamPoster.py b/src/BotYamPoster.py
index 4873c49..1cfd605 100644
--- a/src/BotYamPoster.py
+++ b/src/BotYamPoster.py
@@ -11,15 +11,30 @@ def post_reply(conn, victim_bank, tweet, words, reply_text_bank, postcounter):
if any(word in tweet.data['text'] for word in words):
reply_text = reply_text_bank[random.randint(0, (len(reply_text_bank)-1))]
# Post reply
- if tweet.data['author_id'] in victim_bank['author_id'] and not "@FromBotYam" in tweet.data['text']:
+ try:
+ if tweet.data['author_id'] in victim_bank['author_id'] and not "@FromBotYam" in tweet.data['text']:
reply_text = victim_bank['reply'][random.randint(0,2)] + "\nו" + reply_text
- res = conn.api.create_tweet(
- text=reply_text,
- in_reply_to_tweet_id=tweet["id"]
- )
+ res = conn.api.create_tweet(
+ text=reply_text,
+ in_reply_to_tweet_id=tweet["id"]
+ )
+ except tweepy.errors.TwitterServerError as e:
+ print("ERROR: An error occured, we'll try again in a few minutes. The error: " + str(e))
+ try:
+ if tweet.data['author_id'] in victim_bank['author_id'] and not "@FromBotYam" in tweet.data['text']:
+ reply_text = victim_bank['reply'][random.randint(0,2)] + "\nו" + reply_text
+ res = conn.api.create_tweet(
+ text=reply_text,
+ in_reply_to_tweet_id=tweet["id"]
+ )
+
+ response_data = f"RESPONDING: {res.data['text']}"
+ print(response_data)
+ except Exception as e:
+ print("ERROR: An exception occured. The error: " + str(e))
+ except Exception as e:
+ print("ERROR: An exception occured. The error: " + str(e))
postcounter = postcounter + 1
- response_data = f"RESPONDING: {res.data['text']}"
- print(response_data)
return postcounter
class BotYamPoster(tweepy.StreamingClient):
diff --git a/src/main.py b/src/main.py
index a83c6ca..897e8d4 100644
--- a/src/main.py
+++ b/src/main.py
@@ -5,7 +5,7 @@ from BotYamPoster import init_streamobject
from connector import Connector
def main():
- print("BOT-YAM - VERSION 3.0.1 >>>>")
+ print("BOT-YAM - VERSION 3.0.2 >>>>")
conn = Connector()
stream = init_streamobject(conn)
print("Adding stream rules...")
From c60cd56dfde85012f0e78c0a90aa131dd9586701 Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 00:27:10 +0200
Subject: [PATCH 07/18] Error Handling (#5)
* Update BotYamPoster.py
Error handler
* Update main.py
* Update BotYamPoster.py
lol
---
src/BotYamPoster.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/BotYamPoster.py b/src/BotYamPoster.py
index 1cfd605..d057015 100644
--- a/src/BotYamPoster.py
+++ b/src/BotYamPoster.py
@@ -13,11 +13,11 @@ def post_reply(conn, victim_bank, tweet, words, reply_text_bank, postcounter):
# Post reply
try:
if tweet.data['author_id'] in victim_bank['author_id'] and not "@FromBotYam" in tweet.data['text']:
- reply_text = victim_bank['reply'][random.randint(0,2)] + "\nו" + reply_text
- res = conn.api.create_tweet(
+ reply_text = victim_bank['reply'][random.randint(0,2)] + "\nו" + reply_text
+ res = conn.api.create_tweet(
text=reply_text,
in_reply_to_tweet_id=tweet["id"]
- )
+ )
except tweepy.errors.TwitterServerError as e:
print("ERROR: An error occured, we'll try again in a few minutes. The error: " + str(e))
try:
From acc7c91bfbdd4348ec902d8e2d8d109ec9398c1b Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 02:14:30 +0200
Subject: [PATCH 08/18] CI?
---
.github/workflows/main.yml | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 .github/workflows/main.yml
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000..dd7aca8
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,23 @@
+on:
+ push:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ run_pull:
+ name: run pull
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: install ssh keys
+ # check this thread to understand why its needed:
+ # https://stackoverflow.com/a/70447517
+ run: |
+ install -m 600 -D /dev/null ~/.ssh/id_rsa
+ echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
+ ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
+ - name: connect, pull, build and run
+ run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
+ - name: cleanup
+ run: rm -rf ~/.ssh
From 2ba379280ab84d0d874422a314e84b7e410903ff Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 02:17:08 +0200
Subject: [PATCH 09/18] Hm?
---
.github/workflows/main.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index dd7aca8..c8a64de 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -16,7 +16,7 @@ jobs:
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
- ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
+ echo "${{ secrets.SSH_HOST }}" > ~/.ssh/known_hosts
- name: connect, pull, build and run
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
- name: cleanup
From 04e0b70511adc722063eb00696d56151ec56de69 Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 02:21:36 +0200
Subject: [PATCH 10/18] Maybe now an answer?
---
.github/workflows/main.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index c8a64de..dd7aca8 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -16,7 +16,7 @@ jobs:
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
- echo "${{ secrets.SSH_HOST }}" > ~/.ssh/known_hosts
+ ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: connect, pull, build and run
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
- name: cleanup
From 2ba8e2be249d1ef78248e34ea102b9501c559233 Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 02:29:33 +0200
Subject: [PATCH 11/18] Committing
---
.github/workflows/main.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index dd7aca8..5c39605 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -18,6 +18,6 @@ jobs:
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: connect, pull, build and run
- run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
+ run: ssh -i ~/.ssh/id_rsa ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
- name: cleanup
run: rm -rf ~/.ssh
From 11958835ee988a9ba410b166d6a77d49badb255c Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 02:48:18 +0200
Subject: [PATCH 12/18] ?
---
.github/workflows/main.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 5c39605..03287e1 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -18,6 +18,6 @@ jobs:
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: connect, pull, build and run
- run: ssh -i ~/.ssh/id_rsa ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
+ run: ssh -i ~/.ssh/id_rsa -oHostKeyAlgorithms=+sk-ecdsa-sha2-nistp256@openssh.com ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
- name: cleanup
run: rm -rf ~/.ssh
From 46e279111fc3959f732416d6fe5e60732f660127 Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 03:05:44 +0200
Subject: [PATCH 13/18] well
---
.github/workflows/main.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 03287e1..3218105 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -16,8 +16,9 @@ jobs:
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
+ echo "IdentityFile ~/.ssh/id_rsa" > ~/.ssh/config
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: connect, pull, build and run
- run: ssh -i ~/.ssh/id_rsa -oHostKeyAlgorithms=+sk-ecdsa-sha2-nistp256@openssh.com ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
+ run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
- name: cleanup
run: rm -rf ~/.ssh
From cdbe3a27d640aeb5d584af7dc27051989d171fdd Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 03:16:17 +0200
Subject: [PATCH 14/18] Give me a reason to be happy
---
.github/workflows/main.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 3218105..ba62123 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -15,8 +15,9 @@ jobs:
# https://stackoverflow.com/a/70447517
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
+ chmod 600 ~/.ssh/id_rsa
+ chmod 700 ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
- echo "IdentityFile ~/.ssh/id_rsa" > ~/.ssh/config
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: connect, pull, build and run
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
From 9653dbb123d6b83b083d76860ff5411466c803a8 Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 03:19:56 +0200
Subject: [PATCH 15/18] h
---
.github/workflows/main.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index ba62123..dfd7351 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -19,7 +19,6 @@ jobs:
chmod 700 ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- - name: connect, pull, build and run
- run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
+ ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
- name: cleanup
run: rm -rf ~/.ssh
From 4660178f37402b09fc9c1d7958e7bcd52f1777df Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 03:22:55 +0200
Subject: [PATCH 16/18] AH
---
.github/workflows/main.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index dfd7351..9e59f28 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -19,6 +19,6 @@ jobs:
chmod 700 ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
+ ssh -oHostKeyAlgorithms=+rsa-sha2-512 ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
- name: cleanup
run: rm -rf ~/.ssh
From c50b4e3f68080830e53c5061cfa196f6c153bac1 Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 03:23:58 +0200
Subject: [PATCH 17/18] plis
---
.github/workflows/main.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9e59f28..25fe704 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -19,6 +19,6 @@ jobs:
chmod 700 ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- ssh -oHostKeyAlgorithms=+rsa-sha2-512 ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
+ ssh -oHostKeyAlgorithms=ssh-rsa ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
- name: cleanup
run: rm -rf ~/.ssh
From 984148f633289e76c00d0452956ccfd8f6756aaf Mon Sep 17 00:00:00 2001
From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com>
Date: Sat, 25 Feb 2023 03:30:02 +0200
Subject: [PATCH 18/18] The maybe factor?
---
.github/workflows/main.yml | 25 ++++++++++---------------
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 25fe704..477dd55 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -5,20 +5,15 @@ on:
workflow_dispatch:
jobs:
- run_pull:
- name: run pull
+ build:
+ name: Build
runs-on: ubuntu-latest
-
steps:
- - name: install ssh keys
- # check this thread to understand why its needed:
- # https://stackoverflow.com/a/70447517
- run: |
- install -m 600 -D /dev/null ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- chmod 700 ~/.ssh
- echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
- ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- ssh -oHostKeyAlgorithms=ssh-rsa ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git pull && docker-compose up -d --build && exit"
- - name: cleanup
- run: rm -rf ~/.ssh
+ - name: executing remote ssh commands using password
+ uses: appleboy/ssh-action@v0.1.7
+ with:
+ host: ${{ secrets.SSH_HOST }}
+ username: ${{ secrets.SSH_USER }}
+ password: ${{ secrets.SSH_PASSWORD }}
+ port: 22
+ script: "cd /etc/BotYam && git pull && docker-compose up -d --build"