-
Notifications
You must be signed in to change notification settings - Fork 1
chore: 홈서버 셀프호스트 배포로 전환 (dev 트리거) #86
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
18 commits
Select commit
Hold shift + click to select a range
a9bddf0
Merge pull request #11 from Today-s-Sound/dev
DOHOON0127 634757e
Merge pull request #13 from Today-s-Sound/dev
DOHOON0127 4ebddb0
Merge pull request #14 from Today-s-Sound/dev
DOHOON0127 3ac054b
Merge pull request #15 from Today-s-Sound/dev
DOHOON0127 f6b7d2b
Merge pull request #16 from Today-s-Sound/dev
DOHOON0127 96e1a1a
Merge pull request #17 from Today-s-Sound/dev
DOHOON0127 8032832
Merge pull request #18 from Today-s-Sound/dev
DOHOON0127 478d205
Merge pull request #21 from Today-s-Sound/dev
DOHOON0127 38606a9
Merge pull request #22 from Today-s-Sound/dev
DOHOON0127 062273c
Merge pull request #23 from Today-s-Sound/dev
DOHOON0127 17dd19e
Merge pull request #24 from Today-s-Sound/dev
DOHOON0127 77ac6f0
Merge pull request #27 from Today-s-Sound/dev
DOHOON0127 0b7a627
[Feat] Main으로 합치기
wlgusqkr 735fd80
Merge pull request #69 from Today-s-Sound/dev
wlgusqkr 70041a1
chore: 홈서버 셀프호스트 배포로 전환
0eaae8d
chore: deploy.yml 트리거를 dev로 변경
904d515
chore: Dockerfile 빌드 단계를 gradle wrapper 기반으로 변경
d32bbfd
chore: dev 머지 충돌 해결 — cicd.yml 제거 유지
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,62 @@ | ||
| name: Deploy to homeserver | ||
|
|
||
| on: | ||
| push: | ||
| branches: [dev] | ||
| paths: | ||
| - "src/**" | ||
| - "build.gradle" | ||
| - "settings.gradle" | ||
| - "gradle/**" | ||
| - "Dockerfile" | ||
| - ".github/workflows/deploy.yml" | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: deploy-homeserver-todaysound | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: [self-hosted, homeserver] | ||
| timeout-minutes: 25 | ||
|
|
||
| env: | ||
| REPO_DIR: /Users/parkparkjihyeon/homeserver/services/todaysound/repo | ||
| APP_DIR: /Users/parkparkjihyeon/homeserver/services/todaysound | ||
|
|
||
| steps: | ||
| - name: Sync repo on host | ||
| run: | | ||
| cd "$REPO_DIR" | ||
| git fetch --all --prune | ||
| git reset --hard origin/dev | ||
|
|
||
| - name: Build backend image | ||
| run: | | ||
| cd "$APP_DIR" | ||
| DOCKER_BUILDKIT=1 docker compose build | ||
|
|
||
| - name: Roll out | ||
| run: | | ||
| cd "$APP_DIR" | ||
| docker compose up -d | ||
| docker image prune -f | ||
|
|
||
| - name: Smoke test (e2e via caddy with correct Host) | ||
| run: | | ||
| for i in 1 2 3 4 5 6 7 8 9 10; do | ||
| code=$(docker exec caddy wget -S -q -O- \ | ||
| --header "Host: today-sound.com" \ | ||
| http://localhost/actuator/health 2>&1 \ | ||
| | awk '/HTTP\//{print $2; exit}') | ||
| if [ "$code" = "200" ] || [ "$code" = "401" ] || [ "$code" = "403" ]; then | ||
| echo "Backend OK ($code)" | ||
| exit 0 | ||
| fi | ||
| echo "Retry $i (code=$code)..." | ||
| sleep 6 | ||
| done | ||
| echo "Backend healthcheck failed" | ||
| docker logs todaysound-server --tail 100 || true | ||
| exit 1 |
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,10 +1,15 @@ | ||
| FROM eclipse-temurin:17-jre | ||
|
|
||
| WORKDIR /app | ||
| # syntax=docker/dockerfile:1.7 | ||
|
|
||
| COPY build/libs/*SNAPSHOT*.jar /app/app.jar | ||
| FROM eclipse-temurin:17-jdk AS build | ||
| WORKDIR /src | ||
| COPY . . | ||
| RUN --mount=type=cache,target=/root/.gradle \ | ||
| chmod +x gradlew && \ | ||
| ./gradlew --no-daemon clean bootJar -x test -x asciidoctor | ||
|
|
||
| FROM eclipse-temurin:17-jre | ||
| WORKDIR /app | ||
| COPY --from=build /src/build/libs/*SNAPSHOT*.jar /app/app.jar | ||
| ENV SPRING_PROFILES_ACTIVE=prod | ||
| EXPOSE 8080 | ||
|
|
||
| ENTRYPOINT ["java","-jar","/app/app.jar"] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*SNAPSHOT*.jar와일드카드는 프로젝트 버전이SNAPSHOT이 아니게 변경될 경우(예: 정식 릴리스 시) 빌드 실패를 유발합니다. 유지보수성을 위해*.jar와 같이 더 유연한 패턴을 사용하거나,build.gradle에서archiveFileName을 고정하여 사용하는 것이 안전합니다. (단,*.jar사용 시 빌드 결과물 디렉토리에 단일 JAR만 존재해야 합니다.)