Skip to content

Commit

Permalink
update: 환경별 ECR 변수 신규 생성 및 적용 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
manyb2ns committed Dec 7, 2023
1 parent 712a28b commit 48e2436
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/cr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
LANGUAGE: Korean

- name: notification to swit
uses: roharon/action-swit@v1
with:
webhooks_url: ${{ env.webhook_url }}
MESSAGE: "🏷 ${{ job.status }} 백엔드 OpenAI 코드 리뷰 : Core-service - by ${{ github.actor }}"
# - name: notification to swit
# uses: roharon/action-swit@v1
# with:
# webhooks_url: ${{ env.webhook_url }}
# MESSAGE: "🏷 ${{ job.status }} 백엔드 OpenAI 코드 리뷰 : Core-service - by ${{ github.actor }}"
32 changes: 19 additions & 13 deletions .github/workflows/ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ name: Java CI with Gradle

on:
push:
branches: [ "main", "dev" ]
branches: [ "main", "dev", "refactor-jdb-gitaction-workflow" ]

env:
AWS_REGION: ${{ secrets.AWS_REGION }}
OIDC_ROLE_ARN: ${{ secrets.OIDC_ROLE }}
DEPLOY_ENV: ${{ github.ref == 'refs/heads/main' && 'PROD' || 'DEV' }}
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
ECR_URL: ${{ secrets.AWS_ECR_DEV_CORE }}
AWS_DEV_CORE_ECR: ${{ secrets.AWS_DEV_CORE_ECR }}
AWS_PRD_CORE_ECR: ${{ secrets.AWS_PRD_CORE_ECR }}
webhook_url: ${{ secrets.WEBHOOK }}

permissions:
Expand Down Expand Up @@ -54,14 +56,19 @@ jobs:

- name: Publish Image to ECR(CORE-SERVICE)
run: |
docker tag core-service:latest ${{ env.ECR_URL }}:${{ github.sha }}
docker push ${{ env.ECR_URL }}:${{ github.sha }}
if [ "${{ env.DEPLOY_ENV }}" == "PROD" ]; then
docker tag core-service:latest ${{ env.AWS_PRD_CORE_ECR }}:${{ github.sha }}
docker push ${{ env.AWS_PRD_CORE_ECR }}:${{ github.sha }}
else
docker tag core-service:latest ${{ env.AWS_DEV_CORE_ECR }}:${{ github.sha }}
docker push ${{ env.AWS_DEV_CORE_ECR }}:${{ github.sha }}
fi
- name: notification to swit
uses: roharon/action-swit@v1
with:
webhooks_url: ${{ env.webhook_url }}
MESSAGE: "🏷 ${{ job.status }} 백엔드 ECR 도커파일 업로드 : Core-service - by ${{ github.actor }}"
# - name: notification to swit
# uses: roharon/action-swit@v1
# with:
# webhooks_url: ${{ env.webhook_url }}
# MESSAGE: "🏷 ${{ job.status }} 백엔드 ECR 도커파일 업로드 : Core-service - by ${{ github.actor }}"

- name: Setup Kustomize
uses: imranismail/setup-kustomize@v1
Expand All @@ -77,14 +84,13 @@ jobs:
- name: Update Kustomize image
run: |
if [ "${{ env.DEPLOY_ENV }}" == "PROD" ]; then
KUSTOMIZE_PATH="core-service-kusto/overlays/prd"
KUSTOMIZE_PATH="core-service-kusto/overlays/prd" && cd $KUSTOMIZE_PATH
kustomize edit set image app-core-img="${{ env.AWS_PRD_CORE_ECR }}:${{ github.sha }}"
else
KUSTOMIZE_PATH="core-service-kusto/overlays/dev"
KUSTOMIZE_PATH="core-service-kusto/overlays/dev" && cd $KUSTOMIZE_PATH
kustomize edit set image app-core-img="${{ env.AWS_DEV_CORE_ECR }}:${{ github.sha }}"
fi
KUSTOMIZE_PATH="core-service-kusto/overlays/dev"
cd $KUSTOMIZE_PATH
kustomize edit set image app-core-img="${{ env.ECR_URL }}:${{ github.sha }}"
kustomize build .
- name: Commit minifest files
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches: [ main ]

env:
ecr_url: ${{ secrets.ECR_REPO_DEV }}
role_arn: ${{ secrets.OIDC_ROLE }}
aws_region: ${{ secrets.AWS_REGION }}
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -55,8 +53,8 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: build/test-results/**/*.xml

- name: notification to swit
uses: roharon/action-swit@v1
with:
webhooks_url: ${{ env.webhook_url }}
MESSAGE: "🏷 ${{ job.status }} 백엔드 Unit Test : Core-service - by ${{ github.actor }}"
# - name: notification to swit
# uses: roharon/action-swit@v1
# with:
# webhooks_url: ${{ env.webhook_url }}
# MESSAGE: "🏷 ${{ job.status }} 백엔드 Unit Test : Core-service - by ${{ github.actor }}"

0 comments on commit 48e2436

Please sign in to comment.