Skip to content

Commit

Permalink
rerun cd
Browse files Browse the repository at this point in the history
  • Loading branch information
tanquangduong committed Sep 18, 2024
1 parent 14fa881 commit 9bf121a
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/cd-docker-ec2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,19 @@ jobs:
# Add the user to the docker group
sudo usermod -aG docker $USER
# Apply the new group membership and run Docker commands in a subshell
sudo su - $USER -c "
# Log in to Docker
echo "${{ secrets.DOCKERHUB_TOKEN }}" | sudo docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
# 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
docker info
# Free up disk space
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
"
# Free up disk space
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
EOF

0 comments on commit 9bf121a

Please sign in to comment.