Skip to content

Commit

Permalink
Feat: public ECR Repository 이름
Browse files Browse the repository at this point in the history
  • Loading branch information
rrosiee committed Jul 9, 2024
1 parent 5160f21 commit 39adefb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ jobs:

- name: Login to Amazon ECR
run: |
aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin ${{ secrets.ECR_REPOSITORY }}
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
- name: Build and push Docker image
id: build-image
run: |
IMAGE_TAG=$(date +%Y%m%d%H%M)
docker build -t ${{ secrets.ECR_REPOSITORY }}:$IMAGE_TAG .
docker tag ${{ secrets.ECR_REPOSITORY }}:$IMAGE_TAG ${{ secrets.ECR_REPOSITORY }}:latest
docker push ${{ secrets.ECR_REPOSITORY }}:$IMAGE_TAG
docker push ${{ secrets.ECR_REPOSITORY }}:latest
docker build -t public.ecr.aws/h7p2f6d8/ticats_ai:$IMAGE_TAG .
docker tag public.ecr.aws/h7p2f6d8/ticats_ai:$IMAGE_TAG public.ecr.aws/h7p2f6d8/ticats_ai:latest
docker push public.ecr.aws/h7p2f6d8/ticats_ai:$IMAGE_TAG
docker push public.ecr.aws/h7p2f6d8/ticats_ai:latest
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}

- name: Deploy to EC2
run: |
ssh -o StrictHostKeyChecking=no -i ${{ secrets.EC2_SSH_KEY }} ec2-user@${{ secrets.EC2_INSTANCE_IP }} << 'EOF'
docker pull ${{ secrets.ECR_REPOSITORY }}:latest
docker pull public.ecr.aws/h7p2f6d8/ticats_ai:latest
docker-compose down
docker-compose up -d
EOF
Expand Down

0 comments on commit 39adefb

Please sign in to comment.