Skip to content

cd 플로우 수정 #24

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 1 commit into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/CD-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,13 @@ on:
required: true
EC2_KEY:
required: true
push:
branches:
- develop
paths:
- 'boot/api/**'

jobs:
build:
uses: ./.github/workflows/gradle_build.yml
with:
project-name: api
workflow-id: ${{ github.run_id }}

push-image:
needs: build
Expand All @@ -38,6 +34,7 @@ jobs:
ecr-repository-name: clibi/api
container-name: api-server
secret-manager: arn:aws:secretsmanager:ap-northeast-2:442042528525:secret:dev/clibi/rds-eCWfXL
workflow-id: ${{ github.run_id }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/CD-office.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,12 @@ on:
EC2_KEY:
required: true

push:
branches:
- develop
paths:
- 'boot/api/**'

jobs:
build:
uses: ./.github/workflows/gradle_build.yml
with:
project-name: office
workflow-id: ${{ github.run_id }}

push-image:
needs: build
Expand All @@ -39,6 +34,7 @@ jobs:
ecr-repository-name: clibi/office
secret-manager: arn:aws:secretsmanager:ap-northeast-2:442042528525:secret:dev/clibi/rds-eCWfXL
container-name: office-server
workflow-id: ${{ github.run_id }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/ec2_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
container-name:
required: true
type: string
workflow-id:
required: false
type: string
secrets:
AWS_ACCESS_KEY_ID:
required: true
Expand All @@ -45,13 +48,15 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download the gradle Build File
uses: actions/download-artifact@v4
with:
name: ${{inputs.project-name}}-build
path: ./boot/${{inputs.project-name}}/build/libs
name: ${{ inputs.project-name }}-build-${{ inputs.workflow-id || github.run_id }}
path: ./boot/${{ inputs.project-name }}/build/libs

- name: Configure AWS credentials For ECR and Secrets Manager
uses: aws-actions/configure-aws-credentials@v1
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/gradle_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
required: true
type: string
description: 'The name of the project to build'
workflow-id:
required: false
type: string
description: 'Workflow run ID for artifact naming'
outputs:
build-success:
description: "빌드 성공 여부"
Expand All @@ -20,7 +24,9 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup JDK 21
uses: actions/setup-java@v3
Expand Down Expand Up @@ -60,5 +66,6 @@ jobs:
if: ${{ inputs.project-name != 'ALL' }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.project-name }}-build
name: ${{ inputs.project-name }}-build-${{ inputs.workflow-id || github.run_id }}
path: ./boot/${{ inputs.project-name }}/build/libs
retention-days: 1