Skip to content

Commit c831460

Browse files
committed
chore: add github action file
1 parent cfc1485 commit c831460

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy to EC2
2+
3+
on:
4+
push:
5+
branches:
6+
- deploy
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up SSH
17+
uses: appleboy/ssh-action@v0.1.6
18+
with:
19+
host: ${{ secrets.EC2_HOST }}
20+
username: ${{ secrets.EC2_USER }}
21+
key: ${{ secrets.EC2_SSH_KEY }}
22+
script: |
23+
cd /home/ubuntu/putrack
24+
git pull origin deploy
25+
docker stop putrack || true
26+
docker rm putrack || true
27+
docker build -t putrack .
28+
docker run -d -p 8000:8000 --name putrack putrack

0 commit comments

Comments
 (0)