From 0702640b2618c83fd01e049ae4a23704e9a6cccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=99=A9=EA=B7=9C=ED=98=81?= <126947828+Gyuhyeok99@users.noreply.github.com> Date: Sat, 15 Feb 2025 19:24:01 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EC=BB=A4=EB=AE=A4=EB=8B=88=ED=8B=B0?= =?UTF-8?q?=20=EA=B8=80=20=EB=AA=A9=EB=A1=9D=20=ED=86=A0=ED=81=B0=20?= =?UTF-8?q?=EC=97=86=EC=9D=B4=20=EB=B3=B4=EC=9D=B4=EB=8A=94=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EC=88=98=EC=A0=95,=20=EC=84=9C=EB=B8=8C=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8=20(#215)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 커뮤니티 글 목록 토큰 없이 안보이도록 수정 * chore: submodule 업데이트 --- .../community/board/controller/BoardController.java | 3 +++ src/main/resources/secret | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/example/solidconnection/community/board/controller/BoardController.java b/src/main/java/com/example/solidconnection/community/board/controller/BoardController.java index 40410bdbe..a87552796 100644 --- a/src/main/java/com/example/solidconnection/community/board/controller/BoardController.java +++ b/src/main/java/com/example/solidconnection/community/board/controller/BoardController.java @@ -2,6 +2,8 @@ import com.example.solidconnection.community.post.dto.PostListResponse; import com.example.solidconnection.community.post.service.PostQueryService; +import com.example.solidconnection.custom.resolver.AuthorizedUser; +import com.example.solidconnection.siteuser.domain.SiteUser; import com.example.solidconnection.type.BoardCode; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; @@ -33,6 +35,7 @@ public ResponseEntity findAccessibleCodes() { @GetMapping("/{code}") public ResponseEntity findPostsByCodeAndCategory( + @AuthorizedUser SiteUser siteUser, @PathVariable(value = "code") String code, @RequestParam(value = "category", defaultValue = "전체") String category) { List postsByCodeAndPostCategory = postQueryService diff --git a/src/main/resources/secret b/src/main/resources/secret index 44128519c..88d71bb3e 160000 --- a/src/main/resources/secret +++ b/src/main/resources/secret @@ -1 +1 @@ -Subproject commit 44128519c61cf80b02e113b1cd4e6387c8f54add +Subproject commit 88d71bb3ee42d1733e4e7dcdb9516a4fa0a5bea9 From 1fdf36ccf8995722e9661c6536fe86b0f546ce6d Mon Sep 17 00:00:00 2001 From: Yeongseo Na Date: Sun, 16 Feb 2025 04:39:42 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20stage=20CD=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A6=BD=ED=8A=B8=20=EC=9E=91=EC=84=B1=20(#206)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: stage용 CD 추가 * chore: 기존 릴리즈 cd를 stage와 확실히 구분되게 수정 * fix: syntax 에러 수정 * chore: 스테이지 서버 배포 테스트가 prod에 영향을 주지 않도록 --- .../workflows/{release.yml => prod-cd.yml} | 4 +- .github/workflows/stage-cd.yml | 75 +++++++++++++++++++ 2 files changed, 77 insertions(+), 2 deletions(-) rename .github/workflows/{release.yml => prod-cd.yml} (94%) create mode 100644 .github/workflows/stage-cd.yml diff --git a/.github/workflows/release.yml b/.github/workflows/prod-cd.yml similarity index 94% rename from .github/workflows/release.yml rename to .github/workflows/prod-cd.yml index 43c2e6e80..7a2601800 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/prod-cd.yml @@ -1,8 +1,8 @@ -name: Build Gradle and Deploy +name: "[PROD] Build Gradle and Deploy" on: push: - branches: [ "release" ] + branches: [ "release" ] # todo: 스테이지 서버 cd 테스트 후 master 로 변경 필요 workflow_dispatch: jobs: diff --git a/.github/workflows/stage-cd.yml b/.github/workflows/stage-cd.yml new file mode 100644 index 000000000..7aa70fe65 --- /dev/null +++ b/.github/workflows/stage-cd.yml @@ -0,0 +1,75 @@ +name: "[STAGE] Build Gradle and Deploy" + +on: + push: + branches: [ "stage-test" ] # todo: 스테이지 서버 cd 테스트 후 release 로 변경 필요 + workflow_dispatch: + +jobs: + build-gradle: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Checkout the code + uses: actions/checkout@v4 + with: + token: ${{ secrets.SUBMODULE_ACCESS_TOKEN }} + submodules: true + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - name: Setup Gradle + uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + + - name: Grant execute permission for Gradle wrapper(gradlew) + run: chmod +x ./gradlew + + - name: Build with Gradle + run: ./gradlew bootJar -Dspring.profiles.active=prod + + - name: Copy jar file to remote + uses: appleboy/scp-action@master + with: + host: ${{ secrets.STAGE_HOST }} + username: ${{ secrets.STAGE_USERNAME }} + key: ${{ secrets.STAGE_PRIVATE_KEY }} + source: "./build/libs/*.jar" + target: "/home/${{ secrets.STAGE_USERNAME }}/solid-connect-stage/" + + - name: Copy docker file to remote + uses: appleboy/scp-action@master + with: + host: ${{ secrets.STAGE_HOST }} + username: ${{ secrets.STAGE_USERNAME }} + key: ${{ secrets.STAGE_PRIVATE_KEY }} + source: "./Dockerfile" + target: "/home/${{ secrets.STAGE_USERNAME }}/solid-connect-stage/" + + - name: Copy docker compose file to remote + uses: appleboy/scp-action@master + with: + host: ${{ secrets.STAGE_HOST }} + username: ${{ secrets.STAGE_USERNAME }} + key: ${{ secrets.STAGE_PRIVATE_KEY }} + source: "./docker-compose.yml" + target: "/home/${{ secrets.STAGE_USERNAME }}/solid-connect-stage/" + + - name: Run docker compose + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.STAGE_HOST }} + username: ${{ secrets.STAGE_USERNAME }} + key: ${{ secrets.STAGE_PRIVATE_KEY }} + script_stop: true + script: | + cd /home/${{ secrets.STAGE_USERNAME }}/solid-connect-stage + docker compose down + docker compose up -d --build