Skip to content

Commit

Permalink
cd 1
Browse files Browse the repository at this point in the history
  • Loading branch information
tanquangduong committed Sep 18, 2024
1 parent 401cd9b commit 2cc465c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/cd-docker-ec2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
docker tag ${{ env.DOCKERHUB_TAG }}:latest ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO }}:latest
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO }}:latest
# Part 2: Deploying the container image to the EC2 instance
# Part 2: Deploying the container image to the EC2 instance
- name: Set up SSH
run: |
echo "${{ secrets.AWS_EC2_KEY }}" > ec2-key.pem
Expand All @@ -69,8 +69,8 @@ jobs:
# Log in to Docker
echo "${{ secrets.DOCKERHUB_TOKEN }}" | sudo docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
# Verify Docker login
docker info
# Verify Docker login
sudo docker info
# Free up disk space
docker system prune -a -f
Expand All @@ -80,5 +80,4 @@ jobs:
docker stop ${{ env.DOCKERHUB_REPO }}-container || true
docker rm ${{ env.DOCKERHUB_REPO }}-container || true
docker run --name ${{ env.DOCKERHUB_REPO }}-container -d -p 8501:8501 ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO }}:latest
EOF

0 comments on commit 2cc465c

Please sign in to comment.