-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59c770c
commit 7e6ddd5
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
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@your-ec2-instance-public-dns << '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 }} |