fix: use server password instead of ssh key for deployment
Deploy Iddaai Backend / deploy (push) Failing after 11s
Deploy Iddaai Backend / deploy (push) Failing after 11s
This commit is contained in:
@@ -13,18 +13,18 @@ jobs:
|
|||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install sshpass
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y sshpass
|
||||||
|
|
||||||
- name: Deploy to Raspberry Pi via rsync
|
- name: Deploy to Raspberry Pi via rsync
|
||||||
env:
|
env:
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
|
SERVER_PASSWORD: ${{ secrets.SERVER_PASSWORD }}
|
||||||
SERVER_IP: "95.70.252.214"
|
SERVER_IP: "95.70.252.214"
|
||||||
SERVER_PORT: "2222"
|
SERVER_PORT: "2222"
|
||||||
SERVER_USER: "haruncan"
|
SERVER_USER: "haruncan"
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
export SSHPASS=$SERVER_PASSWORD
|
||||||
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
|
sshpass -e rsync -avz --exclude node_modules --exclude .git --exclude dist --exclude .next --exclude .DS_Store --exclude venv --exclude 'ai-engine/venv' --exclude __pycache__ -e "ssh -o StrictHostKeyChecking=no -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_IP:~/apps/iddaai/be/
|
||||||
chmod 600 ~/.ssh/id_rsa
|
|
||||||
ssh-keyscan -p $SERVER_PORT $SERVER_IP >> ~/.ssh/known_hosts
|
|
||||||
rsync -avz --exclude node_modules --exclude .git --exclude dist --exclude .next --exclude .DS_Store --exclude venv --exclude 'ai-engine/venv' --exclude __pycache__ -e "ssh -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_IP:~/apps/iddaai/be/
|
|
||||||
|
|
||||||
- name: Restart Backend Docker Service
|
- name: Restart Backend Docker Service
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
host: "95.70.252.214"
|
host: "95.70.252.214"
|
||||||
port: "2222"
|
port: "2222"
|
||||||
username: "haruncan"
|
username: "haruncan"
|
||||||
key: ${{ secrets.SSH_KEY }}
|
password: ${{ secrets.SERVER_PASSWORD }}
|
||||||
script: |
|
script: |
|
||||||
cd ~/apps/iddaai
|
cd ~/apps/iddaai
|
||||||
docker compose build backend
|
docker compose build backend
|
||||||
|
|||||||
Reference in New Issue
Block a user