-
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
4 changed files
with
92 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: 이미지 빌드 & 푸쉬 | ||
on: | ||
workflow_call: | ||
inputs: | ||
image-tag: | ||
required: true | ||
type: string | ||
spring-profile: | ||
required: true | ||
type: string | ||
secrets: | ||
DOCKER_USERNAME: | ||
required: true | ||
DOCKER_PASSWORD: | ||
required: true | ||
|
||
env: | ||
IMAGE_TAG: ${{ github.event.inputs.image-tag || 'latest' }} | ||
ACTIVE_PROFILE: ${{ github.event.inputs.spring-profile || 'local' }} | ||
|
||
jobs: | ||
build: | ||
runs-on: [ ubuntu-latest ] | ||
name: 이미지 빌드하기 | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
steps: | ||
- name: GitHub 에서 레포 받아오기 | ||
uses: actions/checkout@v3 | ||
|
||
- name: JDK17 준비하기 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Gradle 애드온 준비하기 | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: 이미지 빌드하고 푸쉬하기 | ||
id: build-image | ||
run: | | ||
chmod +x ./gradlew && | ||
./gradlew jib |
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,21 +1,47 @@ | ||
name: 프로덕션 워크플로우 | ||
on: | ||
push: | ||
branches: [ 'main' ] | ||
branches: [ 'main', 'feature/OING-7' ] | ||
paths: | ||
- 'src/**' # 어드민 API 코드가 변경된 경우 | ||
- '.github/workflows/**' # 워크플로우와 관련된 파일이 변경된 경우 | ||
- 'build.gradle' # Parent Gradle 모듈 설정이 변경된 경우 | ||
- 'settings.gradle' # Parent Gradle 설정이 변경된 경우 | ||
|
||
env: | ||
SPRING_PROFILE: prod | ||
|
||
concurrency: | ||
group: production | ||
|
||
jobs: | ||
prepare-variables: | ||
name: 환경변수 준비하기 | ||
runs-on: ubuntu-latest | ||
outputs: | ||
image-tag: ${{ steps.setup-env.outputs.image-tag }} | ||
spring-profile: ${{ steps.setup-env.outputs.spring-profile }} | ||
steps: | ||
- name: GitHub 에서 레포 받아오기 | ||
uses: actions/checkout@v3 | ||
|
||
- name: 환경변수 출력하기 | ||
id: setup-env | ||
run: | | ||
echo "image-tag=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
echo "spring-profile=$SPRING_PROFILE" >> $GITHUB_OUTPUT | ||
call-build-workflow: | ||
if: github.event_name == 'push' | ||
needs: [ prepare-variables ] | ||
name: 이미지 빌드 | ||
uses: ./.github/workflows/build.yaml | ||
permissions: | ||
id-token: write | ||
contents: read | ||
with: | ||
image-tag: ${{ needs.prepare-variables.outputs.image-tag }} | ||
spring-profile: ${{ needs.prepare-variables.outputs.spring-profile }} | ||
secrets: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} |
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