-
Notifications
You must be signed in to change notification settings - Fork 0
[chore][config-server] 배포 자동화 + 모니터링 설정 추가 #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4a4b70c
chore: ecr 푸시 워크플로우 추가 + ci 워크플로우 통합
rlaxxwls13 9558415
chore: action 라이브러리 버전 수정
rlaxxwls13 38246de
chore: action 라이브러리 버전 수정
rlaxxwls13 d1a64ca
chore: 유레카 설정 추가
rlaxxwls13 49fe6b3
chore: pplication-prod.yml 수정
rlaxxwls13 27041fc
chore: 모니터링 설정 추가
rlaxxwls13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| name: CI/CD - Build, Test, and Deploy | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - dev | ||
| push: | ||
| branches: | ||
| - main | ||
| - dev | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| env: | ||
| AWS_REGION: ap-northeast-2 | ||
| ECR_REPOSITORY: first-ticket/config-server | ||
|
|
||
| jobs: | ||
| # 1) 빌드 + 테스트 (모든 PR/push에서 실행) | ||
| build-and-test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up JDK 21 | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: '21' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Set up Gradle | ||
| uses: gradle/actions/setup-gradle@v6 | ||
|
|
||
| - name: Grant execute permission to gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Build & Test | ||
| run: ./gradlew build --no-daemon | ||
|
|
||
| - name: Upload test report (on failure) | ||
| if: failure() | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: test-report | ||
| path: build/reports/tests/ | ||
| retention-days: 7 | ||
|
|
||
| # 2) ECR 푸시 (main 브랜치 push 시) | ||
| push-to-ecr: | ||
| needs: build-and-test | ||
| if: | | ||
| github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: '21' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x ./gradlew | ||
|
|
||
| - name: Build with Gradle | ||
| run: ./gradlew clean build -x test | ||
|
|
||
| - name: Configure AWS credentials (OIDC) | ||
| uses: aws-actions/configure-aws-credentials@v6 | ||
| with: | ||
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | ||
| aws-region: ${{ env.AWS_REGION }} | ||
|
|
||
| - name: Login to Amazon ECR | ||
| id: ecr-login | ||
| uses: aws-actions/amazon-ecr-login@v2 | ||
|
|
||
| - name: Build, tag, and push image to ECR | ||
| env: | ||
| REGISTRY: ${{ steps.ecr-login.outputs.registry }} | ||
| IMAGE_TAG: ${{ github.sha }} | ||
| run: | | ||
| docker build --platform linux/amd64 \ | ||
| -t $REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \ | ||
| -t $REGISTRY/$ECR_REPOSITORY:latest . | ||
| docker push $REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
| docker push $REGISTRY/$ECR_REPOSITORY:latest | ||
|
|
||
| - name: Show pushed image | ||
| run: | | ||
| echo "✅ Pushed: $ECR_REPOSITORY:${{ github.sha }}" | ||
| echo "✅ Pushed: $ECR_REPOSITORY:latest" |
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,12 +1,22 @@ | ||
| server: | ||
| port: 8080 | ||
|
|
||
| spring: | ||
| cloud: | ||
| inetutils: | ||
| preferred-networks: | ||
| - 10\. | ||
| - 172\. | ||
| - 192\.168\. | ||
|
|
||
| eureka: | ||
| client: | ||
| enabled: true | ||
| service-url: | ||
| defaultZone: ${EUREKA_URL:http://eureka-server:8761/eureka/} | ||
| instance: | ||
| prefer-ip-address: true | ||
|
|
||
| logging: | ||
| level: | ||
| org.springframework.cloud.config: INFO | ||
| org.springframework.cloud.config: INFO | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.