-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Wang HoEun
committed
Apr 3, 2024
1 parent
0198193
commit 8b2b22c
Showing
2 changed files
with
93 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,69 +18,69 @@ jobs: | |
|
||
steps: | ||
|
||
# 1) 워크플로우 실행 전 기본적으로 체크아웃 필요 | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
# 2) JDK 17버전 설치, 다른 JDK 버전을 사용하다면 수정 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'corretto' | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | ||
aws-region: ap-northeast-2 | ||
|
||
# 3) AWS Secrets Manger 환경변수 사용 | ||
- name: Read secrets from AWS Secrets Manager into environment variables | ||
uses: abhilash1in/[email protected] | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | ||
aws-region: ap-northeast-2 | ||
secrets: /secret/kkoolbee | ||
parse-json: false | ||
|
||
# 이 워크플로우는 gradle build | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle # 실제 application build (-x 옵션을 통해 test는 제외) | ||
run: ./gradlew build -x test | ||
|
||
# 디렉토리 생성 | ||
- name: Make Directory | ||
run: mkdir -p deploy | ||
|
||
# Jar 파일 복사 | ||
- name: Copy Jar | ||
run: cp ./build/libs/*.jar ./deploy | ||
|
||
# appspec.yml, script files 파일 복사 | ||
- name: Copy files | ||
run: cp ./scripts/* ./deploy | ||
|
||
- name: Make zip file | ||
run: zip -r ./sanhak-server.zip ./deploy | ||
shell: bash | ||
|
||
- name: Upload to S3 | ||
run: aws s3 cp --region ap-northeast-2 ./sanhak-server.zip s3://$S3_BUCKET_NAME/ | ||
|
||
# Deploy | ||
- name: Deploy | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} | ||
run: | ||
aws deploy create-deployment | ||
--application-name sanhak-server-codedeploy | ||
—deployment-group-name sanhak-server-codedeploy-group | ||
—file-exists-behavior OVERWRITE | ||
—s3-location bucket=kkoolbee-storage,bundleType=zip,key=sanhak-server.zip | ||
—region ap-northeast-2 | ||
# 1) 워크플로우 실행 전 기본적으로 체크아웃 필요 | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
# 2) JDK 17버전 설치, 다른 JDK 버전을 사용하다면 수정 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'corretto' | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | ||
aws-region: ap-northeast-2 | ||
|
||
# 3) AWS Secrets Manger 환경변수 사용 | ||
- name: Read secrets from AWS Secrets Manager into environment variables | ||
uses: abhilash1in/[email protected] | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | ||
aws-region: ap-northeast-2 | ||
secrets: /secret/kkoolbee | ||
parse-json: false | ||
|
||
# 이 워크플로우는 gradle build | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle # 실제 application build (-x 옵션을 통해 test는 제외) | ||
run: ./gradlew build -x test | ||
|
||
# 디렉토리 생성 | ||
- name: Make Directory | ||
run: mkdir -p deploy | ||
|
||
# Jar 파일 복사 | ||
- name: Copy Jar | ||
run: cp ./build/libs/*.jar ./deploy | ||
|
||
# appspec.yml, script files 파일 복사 | ||
- name: Copy files | ||
run: cp ./scripts/* ./deploy | ||
|
||
- name: Make zip file | ||
run: zip -r ./sanhak-server.zip ./deploy | ||
shell: bash | ||
|
||
- name: Upload to S3 | ||
run: aws s3 cp --region ap-northeast-2 ./sanhak-server.zip s3://$S3_BUCKET_NAME/ | ||
|
||
# Deploy | ||
- name: Deploy | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} | ||
run: | ||
aws deploy create-deployment | ||
--application-name sanhak-server-codedeploy | ||
—deployment-group-name sanhak-server-codedeploy-group | ||
—file-exists-behavior OVERWRITE | ||
—s3-location bucket=kkoolbee-storage,bundleType=zip,key=sanhak-server.zip | ||
—region ap-northeast-2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,30 +16,30 @@ jobs: | |
|
||
steps: | ||
|
||
# 1) 워크플로우 실행 전 기본적으로 체크아웃 필요 | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
# 2) JDK 17버전 설치, 다른 JDK 버전을 사용하다면 수정 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'corretto' | ||
|
||
# 3) AWS Secrets Manger 환경변수 사용 | ||
- name: Read secrets from AWS Secrets Manager into environment variables | ||
uses: abhilash1in/[email protected] | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | ||
aws-region: ap-northeast-2 | ||
secrets: /secret/kkoolbee | ||
parse-json: false | ||
|
||
# 이 워크플로우는 gradle build | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle # 실제 application build (-x 옵션을 통해 test는 제외) | ||
run: ./gradlew build -x test | ||
# 1) 워크플로우 실행 전 기본적으로 체크아웃 필요 | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
# 2) JDK 17버전 설치, 다른 JDK 버전을 사용하다면 수정 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'corretto' | ||
|
||
# 3) AWS Secrets Manger 환경변수 사용 | ||
- name: Read secrets from AWS Secrets Manager into environment variables | ||
uses: abhilash1in/[email protected] | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | ||
aws-region: ap-northeast-2 | ||
secrets: /secret/kkoolbee | ||
parse-json: false | ||
|
||
# 이 워크플로우는 gradle build | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle # 실제 application build (-x 옵션을 통해 test는 제외) | ||
run: ./gradlew build -x test |