Skip to content

Commit

Permalink
Update deploy-docker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Hong-Mu authored May 6, 2024
1 parent b0086bf commit c51a77b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/deploy-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ jobs:
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_PEM }}
script: |
sudo aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY }} && \
sudo aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_KEY }} && \
sudo aws configure set default_region ap-northeast-2 && \
sudo aws configure set output json
sudo aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin $ECR_REGISTRY
sudo docker stop server
sudo docker rm server ;
sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGENAME }}
sudo docker run --name=server -d -p 80:5000 --restart=always ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGENAME }}
sudo docker pull $ECR_REGISTRY/${{ secrets.DOCKER_IMAGENAME }}
sudo docker run --name=server -d -p 80:5000 --restart=always $ECR_REGISTRY/${{ secrets.DOCKER_IMAGENAME }}
sudo docker image prune -f

0 comments on commit c51a77b

Please sign in to comment.