Skip to content

Commit b391d0c

Browse files
Create aws.yml
1 parent 5f5c635 commit b391d0c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/aws.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Deploy to EC2
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Replace with your branch name
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: SSH to EC2 and deploy
17+
uses: appleboy/ssh-action@master
18+
with:
19+
host: ${{ secrets.EC2_HOST }}
20+
username: ${{ secrets.EC2_USERNAME }}
21+
key: ${{ secrets.SSH_PRIVATE_KEY }}
22+
script: |
23+
cd /path/to/your/project
24+
git pull origin main
25+
# Add any additional deployment commands here

0 commit comments

Comments
 (0)