Skip to content

Commit 8068da5

Browse files
committed
ci: add GitHub Actions auto deploy workflow
1 parent a1dc873 commit 8068da5

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Deploy to EC2
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Deploy via SSH
14+
uses: appleboy/ssh-action@v1.0.3
15+
with:
16+
host: ${{ secrets.EC2_HOST }}
17+
username: ${{ secrets.EC2_USER }}
18+
key: ${{ secrets.EC2_KEY }}
19+
script: |
20+
cd ~/Spring
21+
git pull origin master
22+
docker-compose up --build -d
23+
docker-compose ps

0 commit comments

Comments
 (0)