Skip to content

Commit

Permalink
[BE] refactor: actions secret 오타 제거 (#24)
Browse files Browse the repository at this point in the history
Signed-off-by: EunJiJung <[email protected]>
  • Loading branch information
bianbbc87 committed Feb 9, 2025
1 parent 4361565 commit 3908eb6
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions .github/actions/ecr-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,63 +86,63 @@ runs:
- name: EC2에서 ECR에 로그인하기
uses: appleboy/ssh-action@master
with:
host: ${{ inputs.EC2_IP }}
username: ${{ inputs.EC2_USERNAME }}
key: ${{ inputs.EC2_SSH_KEY }}
host: ${{ inputs.ec2_ip }}
username: ${{ inputs.ec2_username }}
key: ${{ inputs.ec2_ssh_key }}
script: |
aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | sudo docker login --username AWS --password-stdin ${{ inputs.ECR_URI }}
aws ecr get-login-password --region ${{ inputs.aws_region }} | sudo docker login --username AWS --password-stdin ${{ inputs.ecr_uri }}
- name: 기존 EC2에서 실행중인 컨테이너 종료
uses: appleboy/ssh-action@master
with:
host: ${{ inputs.EC2_IP }}
username: ${{ inputs.EC2_USERNAME }}
key: ${{ inputs.EC2_SSH_KEY }}
host: ${{ inputs.ec2_ip }}
username: ${{ inputs.ec2_username }}
key: ${{ inputs.ec2_ssh_key }}
script: |
sudo docker ps -q | xargs -r docker stop
- name: 기존 EC2에 존재하는 모든 컨테이너 삭제
uses: appleboy/ssh-action@master
with:
host: ${{ inputs.EC2_IP }}
username: ${{ inputs.EC2_USERNAME }}
key: ${{ inputs.EC2_SSH_KEY }}
host: ${{ inputs.ec2_ip }}
username: ${{ inputs.ec2_username }}
key: ${{ inputs.ec2_ssh_key }}
script: |
sudo docker ps -asq | xargs -r docker rm
- name: 기존 EC2에 저장되어있는 이미지 삭제
uses: appleboy/ssh-action@master
with:
host: ${{ inputs.EC2_IP }}
username: ${{ inputs.EC2_USERNAME }}
key: ${{ inputs.EC2_SSH_KEY }}
host: ${{ inputs.ec2_ip }}
username: ${{ inputs.ec2_username }}
key: ${{ inputs.ec2_ssh_key }}
script: |
sudo docker images -q | xargs -r docker rmi
- name: EC2에서 도커에서 사용하지 않는 자원 삭제처리
uses: appleboy/ssh-action@master
with:
host: ${{ inputs.EC2_IP }}
username: ${{ inputs.EC2_USERNAME }}
key: ${{ inputs.EC2_SSH_KEY }}
host: ${{ inputs.ec2_ip }}
username: ${{ inputs.ec2_username }}
key: ${{ inputs.ec2_ssh_key }}
script: |
sudo docker system prune -af
- name: EC2에서 도커 이미지를 가져오기
uses: appleboy/ssh-action@master
with:
host: ${{ inputs.EC2_IP }}
username: ${{ inputs.EC2_USERNAME }}
key: ${{ inputs.EC2_SSH_KEY }}
host: ${{ inputs.ec2_ip }}
username: ${{ inputs.ec2_username }}
key: ${{ inputs.ec2_ssh_key }}
script: |
sudo docker pull ${{ inputs.ECR_URI }}/${{ inputs.namespace }}/${{ inputs.ecr_repo }}:${{ github.sha }}
sudo docker pull ${{ inputs.ecr_uri }}/${{ inputs.namespace }}/${{ inputs.ecr_repo }}:${{ github.sha }}
- name: ECR에서 불러온 이미지를 도커에서 실행
uses: appleboy/ssh-action@master
with:
host: ${{ inputs.EC2_IP }}
username: ${{ inputs.EC2_USERNAME }}
key: ${{ inputs.EC2_SSH_KEY }}
host: ${{ inputs.ec2_ip }}
username: ${{ inputs.ec2_username }}
key: ${{ inputs.ec2_ssh_key }}
script: |
sudo docker stop ${{ inputs.container_name }} || true
sudo docker rm ${{ inputs.container_name }} || true
Expand Down

0 comments on commit 3908eb6

Please sign in to comment.