Skip to content

Commit a46dd72

Browse files
committed
feat: ec2에 cd
1 parent 295cf6b commit a46dd72

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/build-deploy.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,15 @@ jobs:
2424
password: ${{ vars.DOCKERHUB_PASSWORD}}
2525

2626
- name: Push Docker image
27-
run: docker push ${{ vars.DOCKERHUB_USERNAME}}/erica-favicon-f:latest
27+
run: docker push ${{ vars.DOCKERHUB_USERNAME}}/erica-favicon-f:latest
28+
29+
- name: Deploy to EC2
30+
uses: appleboy/ssh-action@master
31+
with:
32+
host: ${{ secrets.EC2_HOST }}
33+
username: favicon
34+
key: ${{ secrets.EC2_SSH_KEY }}
35+
script: |
36+
docker pull ${{ vars.DOCKER_USERNAME }}/erica-favicon-f:latest
37+
docker rm -f front 2>dev/null || true
38+
docker run --name front -d -p 80:3000 ${{ vars.DOCKER_USERNAME }}/erica-favicon-f:latest

0 commit comments

Comments
 (0)