The maybe factor?

This commit is contained in:
Lucy Joshua 2023-02-25 03:30:02 +02:00 committed by GitHub
parent c50b4e3f68
commit 984148f633
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,20 +5,15 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
run_pull: build:
name: run pull name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: install ssh keys - name: executing remote ssh commands using password
# check this thread to understand why its needed: uses: appleboy/ssh-action@v0.1.7
# https://stackoverflow.com/a/70447517 with:
run: | host: ${{ secrets.SSH_HOST }}
install -m 600 -D /dev/null ~/.ssh/id_rsa username: ${{ secrets.SSH_USER }}
chmod 600 ~/.ssh/id_rsa password: ${{ secrets.SSH_PASSWORD }}
chmod 700 ~/.ssh port: 22
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa script: "cd /etc/BotYam && git pull && docker-compose up -d --build"
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