Skip to content

Commit

Permalink
Update dockerizing_to_ecr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
emibgo2 authored Apr 9, 2024
1 parent 2d1895d commit 6f0ba45
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/dockerizing_to_ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@ jobs:
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
- name: AWS SSM Send-Command
uses: peterkimzz/aws-ssm-send-command@master
id: ssm
with:
aws-region: ${{ env.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
instance-ids: ${{ secrets.EC2_INSTANCE_ID }}

working-directory: /home/ubuntu/app
command: sudo -s && sudo docker-compose pull api && sudo echo 'y' | sudo docker container prune && sudo docker-compose up -d && sudo echo 'y' | sudo docker system prune
comment: Server restart!
# - name: EC2 server deploy
# uses: appleboy/ssh-action@master
# - name: AWS SSM Send-Command
# uses: peterkimzz/aws-ssm-send-command@master
# id: ssm
# with:
# host: ${{ secrets.EC2_HOST_IP }}
# key: ${{ secrets.EC2_SSH_KEY }}
# username: ${{ secrets.EC2_USER_NAME }}
# port: ${{ secrets.EC2_PORT }}
# script: |
# ~/app &&
# sudo docker-compose up -d &&
# sudo echo 'y' | sudo docker system prune
# aws-region: ${{ env.AWS_REGION }}
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# instance-ids: ${{ secrets.EC2_INSTANCE_ID }}

# working-directory: /home/ubuntu/app
# command: sudo -s && sudo docker-compose pull api && sudo echo 'y' | sudo docker container prune && sudo docker-compose up -d && sudo echo 'y' | sudo docker system prune
# comment: Server restart!
- name: EC2 server deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST_IP }}
key: ${{ secrets.EC2_SSH_KEY }}
username: ${{ secrets.EC2_USER_NAME }}
port: ${{ secrets.EC2_PORT }}
script: |
~/app &&
sudo docker-compose up -d &&
sudo echo 'y' | sudo docker system prune

0 comments on commit 6f0ba45

Please sign in to comment.