Skip to content

Commit b9c137f

Browse files
committed
update deploy workflow
1 parent ed0b58e commit b9c137f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
deploy:
7+
docker-build-push:
88
runs-on: ubuntu-latest
99

1010
steps:
@@ -28,3 +28,17 @@ jobs:
2828
- name: Push Docker image to Amazon ECR
2929
run: |
3030
docker push ${{ secrets.ECR_REPO }}:latest
31+
32+
deploy:
33+
runs-on: ubuntu-latest
34+
needs: docker-build-push
35+
steps:
36+
- name: Deploy via SSH to EC2
37+
uses: appleboy.ssh-action@v1.2.0
38+
with:
39+
host: ${{ secrets.EC2_HOST }}
40+
username: ubuntu
41+
key: ${{ secrets.SSH_PRIVATE_KEY_EC2 }}
42+
scrpit: |
43+
docker compose pull
44+
docker compose up -d --forse-recreate

0 commit comments

Comments
 (0)