Skip to content

Commit 5736f29

Browse files
committed
Deploy docker container on EC2
1 parent 912e7d1 commit 5736f29

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,17 @@ jobs:
6767
run: |
6868
docker push ${{ secrets.DOCKER_HUB_USERNAME}}/text-classification-using-mlops:latest
6969
70+
- name: Deploy to EC2
71+
if: success()
72+
uses: appleboy/[email protected]
73+
with:
74+
host: ${{ secrets.EC2_HOST }}
75+
username: ${{ secrets.EC2_USER }}
76+
key: ${{ secrets.EC2_SSH_KEY }}
77+
script: |
78+
docker pull ${{ secrets.DOCKER_HUB_USERNAME }}/text-classification-using-mlops:latest
79+
docker stop my-app || true
80+
docker rm my-app || true
81+
docker run -p 80:5000 --name my-app \
82+
-e DAGSHUB_PAT=${{ secrets.DAGSHUB_PAT }} \
83+
${{ secrets.DOCKER_HUB_USERNAME }}/text-classification-using-mlops:latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,4 @@ target/
9090
venv
9191
models
9292
reports
93+
mlruns

0 commit comments

Comments
 (0)