name: Deploy to EC2
on:
push:
branches:
– main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up SSH agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy to EC2
run: |
ssh -o StrictHostKeyChecking=no [email protected] "cd /home/ubuntu/my-app && git pull origin main && docker-compose down && docker-compose up -d --build"
i ran this yml file and try to deploy a basic mern app on ec2 using docker-compose file but getting this error Permission denied (publickey). Error: Process completed with exit code 255