This is my yml file:
name: Deployment M1 Develop
on:
push:
branches:
- develop
paths:
- 'src/8.2/**'
- '.github/workflows/deploy_dev.yml'
jobs:
build:
runs-on: ubuntu-latest
container: openmage/php:8.2.18
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run composer install
run: composer install
- name: Install rsync and openssh-client
run: |
apt-get update
apt-get install -y rsync openssh-client
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.PIPELINE }}
known_hosts: unnecessary
- name: Create SSH directory
run: mkdir -p ~/.ssh
- name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: Rsync files to remote server
run: |
rsync -avz --exclude-from excludes.txt --delete ./* ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/html/
- name: Execute deploy.sh on remote server
run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'bash -s' < /var/www/html/.github/deploy_dev.sh
THE PIPELINE variable contains the private key content. Not sure what am I doing wrong here, but i still receiving this error:
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(231) [sender=3.2.7]
Error: Process completed with exit code 255.
Any clue or help is appreciated. Thanks!