Skip to content

Commit 671f3e5

Browse files
authored
Merge pull request #216 from solid-connection/develop
[RELEASE] 250216 릴리즈
2 parents 1039236 + 1fdf36c commit 671f3e5

4 files changed

Lines changed: 81 additions & 3 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Build Gradle and Deploy
1+
name: "[PROD] Build Gradle and Deploy"
22

33
on:
44
push:
5-
branches: [ "release" ]
5+
branches: [ "release" ] # todo: 스테이지 서버 cd 테스트 후 master 로 변경 필요
66
workflow_dispatch:
77

88
jobs:

.github/workflows/stage-cd.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: "[STAGE] Build Gradle and Deploy"
2+
3+
on:
4+
push:
5+
branches: [ "stage-test" ] # todo: 스테이지 서버 cd 테스트 후 release 로 변경 필요
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-gradle:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
14+
steps:
15+
- name: Checkout the code
16+
uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.SUBMODULE_ACCESS_TOKEN }}
19+
submodules: true
20+
21+
- name: Set up JDK 17
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: '17'
25+
distribution: 'temurin'
26+
27+
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
28+
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
29+
- name: Setup Gradle
30+
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
31+
32+
- name: Grant execute permission for Gradle wrapper(gradlew)
33+
run: chmod +x ./gradlew
34+
35+
- name: Build with Gradle
36+
run: ./gradlew bootJar -Dspring.profiles.active=prod
37+
38+
- name: Copy jar file to remote
39+
uses: appleboy/scp-action@master
40+
with:
41+
host: ${{ secrets.STAGE_HOST }}
42+
username: ${{ secrets.STAGE_USERNAME }}
43+
key: ${{ secrets.STAGE_PRIVATE_KEY }}
44+
source: "./build/libs/*.jar"
45+
target: "/home/${{ secrets.STAGE_USERNAME }}/solid-connect-stage/"
46+
47+
- name: Copy docker file to remote
48+
uses: appleboy/scp-action@master
49+
with:
50+
host: ${{ secrets.STAGE_HOST }}
51+
username: ${{ secrets.STAGE_USERNAME }}
52+
key: ${{ secrets.STAGE_PRIVATE_KEY }}
53+
source: "./Dockerfile"
54+
target: "/home/${{ secrets.STAGE_USERNAME }}/solid-connect-stage/"
55+
56+
- name: Copy docker compose file to remote
57+
uses: appleboy/scp-action@master
58+
with:
59+
host: ${{ secrets.STAGE_HOST }}
60+
username: ${{ secrets.STAGE_USERNAME }}
61+
key: ${{ secrets.STAGE_PRIVATE_KEY }}
62+
source: "./docker-compose.yml"
63+
target: "/home/${{ secrets.STAGE_USERNAME }}/solid-connect-stage/"
64+
65+
- name: Run docker compose
66+
uses: appleboy/ssh-action@master
67+
with:
68+
host: ${{ secrets.STAGE_HOST }}
69+
username: ${{ secrets.STAGE_USERNAME }}
70+
key: ${{ secrets.STAGE_PRIVATE_KEY }}
71+
script_stop: true
72+
script: |
73+
cd /home/${{ secrets.STAGE_USERNAME }}/solid-connect-stage
74+
docker compose down
75+
docker compose up -d --build

src/main/java/com/example/solidconnection/community/board/controller/BoardController.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import com.example.solidconnection.community.post.dto.PostListResponse;
44
import com.example.solidconnection.community.post.service.PostQueryService;
5+
import com.example.solidconnection.custom.resolver.AuthorizedUser;
6+
import com.example.solidconnection.siteuser.domain.SiteUser;
57
import com.example.solidconnection.type.BoardCode;
68
import lombok.RequiredArgsConstructor;
79
import org.springframework.http.ResponseEntity;
@@ -33,6 +35,7 @@ public ResponseEntity<?> findAccessibleCodes() {
3335

3436
@GetMapping("/{code}")
3537
public ResponseEntity<?> findPostsByCodeAndCategory(
38+
@AuthorizedUser SiteUser siteUser,
3639
@PathVariable(value = "code") String code,
3740
@RequestParam(value = "category", defaultValue = "전체") String category) {
3841
List<PostListResponse> postsByCodeAndPostCategory = postQueryService

src/main/resources/secret

0 commit comments

Comments
 (0)