Skip to content

Commit

Permalink
Merge pull request #232 from SWM-NM/dev
Browse files Browse the repository at this point in the history
🐛 [FIX] 단계 삭제 및 docker build 코드 변경 #220
  • Loading branch information
miiiinju1 authored Sep 4, 2023
2 parents 7b5a5b1 + f5e1137 commit 0c23dac
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ jobs:
- name: Build with Gradle
run: ./gradlew clean bootJar -x test

aws-deploy:
runs-on: ubuntu-latest
needs: build

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand All @@ -52,22 +47,18 @@ jobs:
aws-region: ${{ env.AWS_REGION }}
mask-aws-account-id: true # AWS 계정 ID를 마스킹하여 보안 강화

- name: Login to ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Login to Public ECR
run: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/s7z8j0e6

- name: Build and Push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{env.GITHUB_SHA}}
- name: Build Docker Image
run: docker build -t morandi-backend .

ec2-deploy:
runs-on: ubuntu-latest
needs: aws-deploy
- name: Tag Docker Image
run: docker tag morandi-backend:latest public.ecr.aws/s7z8j0e6/morandi-backend:latest

- name: Push Docker Image to ECR
run: docker push public.ecr.aws/s7z8j0e6/morandi-backend:latest

steps:
- name: appleboy SSH and Deploy to EC2
uses: appleboy/[email protected] # ssh 접속하는 오픈소스
with:
Expand Down

0 comments on commit 0c23dac

Please sign in to comment.