Skip to content

Commit

Permalink
Update deployment.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
dudgns3443 authored Dec 12, 2024
1 parent 0e36046 commit 60d1034
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
# AWS_REGION: ap-northeast-2
AWS_REGION: us-east-1
ECR_URL: 534420079206.dkr.ecr.ap-northeast-2.amazonaws.com/
ECR_URL: 534420079206.dkr.ecr.us-east-1.amazonaws.com/cicd-test:kyh

jobs:
CI:
Expand All @@ -25,39 +25,39 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: JDK 17 설치
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
cache: 'gradle'
# - name: JDK 17 설치
# uses: actions/setup-java@v4
# with:
# distribution: 'oracle'
# java-version: '17'
# cache: 'gradle'

- name: ECR login
run: aws ecr get-login-password | docker login --username AWS --password-stdin 534420079206.dkr.ecr.ap-northeast-2.amazonaws.com
# - name: ECR login
# run: aws ecr get-login-password | docker login --username AWS --password-stdin 534420079206.dkr.ecr.ap-northeast-2.amazonaws.com

- name: Gradle 명령 실행 권한 부여
run: chmod +x ./gradlew
shell: bash
# - name: Gradle 명령 실행 권한 부여
# run: chmod +x ./gradlew
# shell: bash

- name: Gradle로 프로젝트 Build
run: ./gradlew build -x test
# - name: Gradle로 프로젝트 Build
# run: ./gradlew build -x test

- name: Container build
run: docker build -t ${{ env.ECR_URL }} .
# - name: Container build
# run: docker build -t ${{ env.ECR_URL }} .

- name: Container Push
run : docker push ${{ env.ECR_URL }}
CD:
name: Deploy
runs-on: ubuntu-latest
needs: CI
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
# - name: Container Push
# run : docker push ${{ env.ECR_URL }}
# CD:
# name: Deploy
# runs-on: ubuntu-latest
# needs: CI
# steps:
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v2
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ env.AWS_REGION }}

- name: Deploy to ECS
run: aws ecs update-service --cluster cicd-test --service cicd-test --task-definition first-run-task-definition:7 --force-new-deployment
# - name: Deploy to ECS
# run: aws ecs update-service --cluster cicd-test --service cicd-test --task-definition first-run-task-definition:7 --force-new-deployment

0 comments on commit 60d1034

Please sign in to comment.