Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sinchan77 authored Jan 28, 2024
1 parent b5e3b4d commit 61ce842
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Push-to-EC2

# Trigger deployment only on push to master branch
on:
push:
branches:
- master

jobs:
deploy:
name: Deploy to EC2 on master branch push
runs-on: ubuntu-latest

steps:
- name: Checkout the files
uses: actions/checkout@v2

- name: Deploy to Server 1
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.EC2_SSH_KEY }}
REMOTE_HOST: ${{ secrets.HOST_DNS }}
REMOTE_USER: ${{ secrets.USERNAME }}
TARGET: ${{ secrets.TARGET_DIR }}

0 comments on commit 61ce842

Please sign in to comment.