Skip to content

Commit

Permalink
🔧 Yml 파일 변경
Browse files Browse the repository at this point in the history
workflows의 yml과 application.yml 운영 버전으로 변경
  • Loading branch information
min-0 committed Oct 16, 2024
1 parent f8a6138 commit fd4c17c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
name: Mapddang-Dev
name: Java CI with Gradle

on:
push:
branches: [ "develop" ]
branches: [ "main" ]
pull_request:
branches: [ "develop" ]
branches: [ "main" ]

env:
AWS_REGION: ap-northeast-2
AWS_S3_BUCKET: mapddang-test-s3
AWS_CODE_DEPLOY_APPLICATION: mapddang-test
AWS_CODE_DEPLOY_GROUP: mapddang-test-group
MYSQL_URL_DEV: ${{ secrets.MYSQL_URL_DEV }}
AWS_S3_BUCKET: ${{ secrets.AWS_BUCKET_NAME }}
AWS_CODE_DEPLOY_APPLICATION: mapddang-CD
AWS_CODE_DEPLOY_GROUP: mapddang-CD-group
MYSQL_URL: ${{ secrets.MYSQL_URL }}
MYSQL_USERNAME: ${{ secrets.MYSQL_USERNAME }}
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
APPLE_CLIENT_ID_DEV: ${{ secrets.APPLE_CLIENT_ID_DEV }}
APPLE_CLIENT_ID: ${{ secrets.APPLE_CLIENT_ID }}
APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_PRIVATE_KEY: ${{ secrets.APPLE_PRIVATE_KEY }}
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
ACCESS_TOKEN_EXPIRE_DEV: ${{ secrets.ACCESS_TOKEN_EXPIRE_DEV }}
REFRESH_TOKEN_EXPIRE_DEV: ${{ secrets.REFRESH_TOKEN_EXPIRE_DEV }}
EC2_ACCESS_KEY_DEV: ${{ secrets.EC2_ACCESS_KEY_DEV }}
EC2_SECRET_KEY_DEV: ${{ secrets.EC2_SECRET_KEY_DEV }}
AWS_BUCKET_NAME_DEV: ${{ secrets.AWS_BUCKET_NAME_DEV }}
ACCESS_TOKEN_EXPIRE: ${{ secrets.ACCESS_TOKEN_EXPIRE }}
REFRESH_TOKEN_EXPIRE: ${{ secrets.REFRESH_TOKEN_EXPIRE }}
AWS_S3_ACCESS_KEY: ${{ secrets.AWS_S3_ACCESS_KEY }}
AWS_S3_SECRET_KEY: ${{ secrets.AWS_S3_SECRET_KEY }}

jobs:
build-with-gradle:
Expand All @@ -50,16 +49,16 @@ jobs:
- name: Setup AWS credential
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.EC2_ACCESS_KEY_DEV }}
aws-secret-access-key: ${{ secrets.EC2_SECRET_KEY_DEV }}
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_KEY }}
aws-region: ap-northeast-2
#ZIP 파일을 S3 버킷에 업로드
- name: Upload to AWS S3
run: |
aws deploy push \
--application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} \
--ignore-hidden-files \
--s3-location s3://$AWS_S3_BUCKET/cicd/$GITHUB_SHA.zip \
--s3-location s3://$AWS_S3_BUCKET/cicdtest/$GITHUB_SHA.zip \
--source .
#업로드된 ZIP 파일을 CodeDeploy로 배포
- name: AWS Code Deploy
Expand All @@ -68,4 +67,4 @@ jobs:
--application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name ${{ env.AWS_CODE_DEPLOY_GROUP }} \
--s3-location bucket=$AWS_S3_BUCKET,bundleType=zip,key=cicd/$GITHUB_SHA.zip
--s3-location bucket=$AWS_S3_BUCKET,bundleType=zip,key=cicdtest/$GITHUB_SHA.zip
9 changes: 4 additions & 5 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ social-login:
provider:
apple:
grant-type: authorization_code
client-id: ${APPLE_CLIENT_ID_DEV}
client-id: ${APPLE_CLIENT_ID}
key-id: ${APPLE_KEY_ID} # 애플에서 제공하는 키의 ID
team-id: ${APPLE_TEAM_ID} # 애플 개발자 계정의 팀 ID
audience: https://appleid.apple.com
Expand All @@ -40,12 +40,11 @@ jwt:
cloud:
aws:
credentials:
accessKey: ${EC2_ACCESS_KEY_DEV}
secretKey: ${EC2_SECRET_KEY_DEV}
accessKey: ${AWS_S3_ACCESS_KEY}
secretKey: ${AWS_S3_SECRET_KEY}
region:
static: ap-northeast-2
stack:
auto: false
s3:
bucketName: ${AWS_BUCKET_NAME_DEV}

bucketName: ${AWS_BUCKET_NAME}

0 comments on commit fd4c17c

Please sign in to comment.