-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
190 changed files
with
4,977 additions
and
8,666 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
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
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
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
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
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 |
---|---|---|
@@ -1,39 +1,43 @@ | ||
name: FE PIPELINE | ||
# name: FE PIPELINE | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
paths: | ||
- 'client/**' | ||
# on: | ||
# push: | ||
# branches: | ||
# - dev | ||
# paths: | ||
# - 'client/**' | ||
|
||
permissions: #github actions bot에게 권한 열기 | ||
contents: write | ||
pages: write | ||
id-token: write | ||
# permissions: | ||
# contents: write | ||
# pages: write | ||
# id-token: write | ||
|
||
jobs: | ||
fe-pipeline: | ||
runs-on: ubuntu-latest | ||
# jobs: | ||
# fe-pipeline: | ||
# runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
|
||
- name: Git Config | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
# - name: Git Config | ||
# run: | | ||
# git config --global user.name 'github-actions[bot]' | ||
# git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
|
||
- name: LOG | ||
run: | | ||
# - name: LOG | ||
# run: | | ||
# timestamp=$(date +"%Y-%m-%d_%H-%M-%S") | ||
# log_file="DEPLOY_LOG/client/FE_CD_LOG_$timestamp.log" | ||
# mkdir -p DEPLOY_LOG/client | ||
# echo "프론트엔드 배포 로그" >> "$log_file" | ||
# git add "$log_file" | ||
# git commit -m "release: $timestamp FE 배포 완료" | ||
# git push origin dev | ||
|
||
timestamp=$(date +"%Y-%m-%d_%H-%M-%S") | ||
log_file="DEPLOY_LOG/client/FE_CD_LOG-$timestamp.log" | ||
mkdir -p DEPLOY_LOG/client | ||
echo "프론트엔드 배포 로그" >> "$log_file" | ||
git fetch origin | ||
git checkout prod || git checkout -b prod | ||
git add "$log_file" | ||
git commit -m "release: $timestamp FE 배포 완료" | ||
git push origin prod --force | ||
# - name: Merge to Prod | ||
# run: | | ||
# git fetch origin | ||
# git checkout prod || git checkout -b prod | ||
# git merge dev | ||
# git push origin prod |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Image Resize | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
image-resize: | ||
name: calibreapp/image-actions | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@main | ||
- name: Compress Images | ||
uses: calibreapp/image-actions@main | ||
with: | ||
githubToken: ${{ secrets.IMAGE_RESIZE_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Messaging CICD | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
paths: | ||
- 'server-messaging/**' | ||
|
||
env: | ||
AWS_REGION: ap-northeast-2 | ||
ECR_REPOSITORY: t3-back-messagingecr2 | ||
ECS_CLUSTER: t3-back-ecscluster2 | ||
ECS_CONTAINER: t3-back-messagingcontainer2 | ||
ECS_SERVICE: t3-back-ecscluster2/t3-back-messagingservice2 | ||
ECS_TASK_DEFINITION: task-definition-messaging.json | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
ci-cd: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
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: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Grant Grant Permission | ||
run: chmod +x server-messaging/gradlew | ||
|
||
- name: Inject secure | ||
run: echo "${{ secrets.MESSAGING_SECURE_DEV }}" > server-messaging/src/main/resources/secure.properties | ||
|
||
- name: Build with Gradle | ||
run: | | ||
cd server-messaging | ||
./gradlew clean build | ||
- name: Replace AWS ID | ||
run: | | ||
sed -i "s/{AWS_ACCOUNT_ID}/${{ secrets.AWS_ACCOUNT_ID }}/g" ${{ env.ECS_TASK_DEFINITION }} | ||
- name: Login ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Push ECR | ||
id: build-image | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
IMAGE_TAG: latest | ||
run: | | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG ./server-messaging | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT | ||
- name: Image ID to ECS TASK | ||
id: task-def | ||
uses: aws-actions/amazon-ecs-render-task-definition@v1 | ||
with: | ||
task-definition: ${{ env.ECS_TASK_DEFINITION }} | ||
container-name: ${{ env.ECS_CONTAINER }} | ||
image: ${{ steps.build-image.outputs.image }} | ||
|
||
- name: Deploy ECS | ||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1 | ||
with: | ||
task-definition: ${{ steps.task-def.outputs.task-definition }} | ||
service: ${{ env.ECS_SERVICE }} | ||
cluster: ${{ env.ECS_CLUSTER }} | ||
wait-for-service-stability: true |
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: PAYMENT CICD | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
paths: | ||
- 'server-payment/**' | ||
|
||
env: | ||
AWS_REGION: ap-northeast-2 | ||
ECR_REPOSITORY: t3-back-paymentecr2 | ||
ECS_CLUSTER: t3-back-ecscluster2 | ||
ECS_CONTAINER: t3-back-paymentcontainer2 | ||
ECS_SERVICE: t3-back-ecscluster2/t3-back-paymentservice2 | ||
ECS_TASK_DEFINITION: task-definition-payment.json | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
ci-cd: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
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: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Grant Grant Permission | ||
run: chmod +x server-payment/gradlew | ||
|
||
- name: Inject secure | ||
run: echo "${{ secrets.PAYMENT_SECURE_DEV }}" > server-payment/src/main/resources/secure.properties | ||
|
||
- name: Build with Gradle | ||
run: | | ||
cd server-payment | ||
./gradlew clean build | ||
- name: Replace AWS ID | ||
run: | | ||
sed -i "s/{AWS_ACCOUNT_ID}/${{ secrets.AWS_ACCOUNT_ID }}/g" ${{ env.ECS_TASK_DEFINITION }} | ||
- name: Login ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Push ECR | ||
id: build-image | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
IMAGE_TAG: latest | ||
run: | | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG ./server-payment | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT | ||
- name: Image ID to ECS TASK | ||
id: task-def | ||
uses: aws-actions/amazon-ecs-render-task-definition@v1 | ||
with: | ||
task-definition: ${{ env.ECS_TASK_DEFINITION }} | ||
container-name: ${{ env.ECS_CONTAINER }} | ||
image: ${{ steps.build-image.outputs.image }} | ||
|
||
- name: Deploy ECS | ||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1 | ||
with: | ||
task-definition: ${{ steps.task-def.outputs.task-definition }} | ||
service: ${{ env.ECS_SERVICE }} | ||
cluster: ${{ env.ECS_CLUSTER }} | ||
wait-for-service-stability: true |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
백엔드 배포 로그 |
Oops, something went wrong.