Skip to content

Commit

Permalink
cicd final test 1
Browse files Browse the repository at this point in the history
  • Loading branch information
tanquangduong committed Sep 18, 2024
1 parent bc1ead7 commit b69677b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions cd-docker-ec2.yml → backup-cd-docker-ec2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,15 @@ 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
sudo docker system prune -a -f
# Pull the Docker image and run the container
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO }}:latest
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
sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO }}:latest
sudo docker stop ${{ env.DOCKERHUB_REPO }}-container || true
sudo docker rm ${{ env.DOCKERHUB_REPO }}-container || true
sudo docker run --name ${{ env.DOCKERHUB_REPO }}-container -d -p 8501:8501 ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO }}:latest
EOF

0 comments on commit b69677b

Please sign in to comment.