Skip to content

Merge pull request #155 from AnkanSaha/dev #7

Merge pull request #155 from AnkanSaha/dev

Merge pull request #155 from AnkanSaha/dev #7

Workflow file for this run

name: Send Code to VM
on:
push:
branches:
- main
jobs:
send-code:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup SSH
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Create SSH Private Key File
run: |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > private_key.pem
chmod 600 private_key.pem
- name: Copy code to VM
run: |
sudo scp -o StrictHostKeyChecking=no -i private_key.pem -r ./* ${{ secrets.USERNAME }}@${{ secrets.VM_IP }}:~/ # Copies all files and directories to the home directory of the user on VM
- name: Clean Up
run: |
rm private_key.pem