-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (27 loc) · 891 Bytes
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: CI/CD Pipeline
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up SSH
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy to EC2
run: |
ssh -o StrictHostKeyChecking=no ec2-user@ec2-54-168-82-95.ap-northeast-1.compute.amazonaws.com << 'EOF'
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
docker pull mohankrishnagr/infosys_text-summarization:final
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker run -d -p 80:8000 mohankrishnagr/infosys_text-summarization:final
EOF
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}