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