Skip to content

feat: github workflow created #1

feat: github workflow created

feat: github workflow created #1

Workflow file for this run

name: Deploy to EC2
on:
push:
branches:
- master # Replace with your branch name
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure SSH
env:
EC2_PRIVATE_KEY: ${{ secrets.EC2_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh
echo "$EC2_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 400 ~/.ssh/id_rsa
- name: Clone repository on EC2
env:
EC2_HOST: ${{ secrets.EC2_HOST }}
EC2_USER: ${{ secrets.EC2_USER }}
run: |
ssh -o StrictHostKeyChecking=no $EC2_USER@$EC2_HOST '
git clone ${{ github.event.repository.clone_url }}
'