Skip to content

fix: Add remote server SSH host key #2

fix: Add remote server SSH host key

fix: Add remote server SSH host key #2

Workflow file for this run

name: Deploy to VM
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan 4.228.216.31 >> ~/.ssh/known_hosts
- name: Deploy project to VM
run: |
rsync -avz --delete ./src/ [email protected]:/var/www/html/
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}