diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE/feature_template.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE/feature_template.md diff --git a/.github/PULL_REQUEST_TEMPLATE/release_template.md b/.github/PULL_REQUEST_TEMPLATE/release_template.md new file mode 100644 index 0000000..d5dc635 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/release_template.md @@ -0,0 +1,17 @@ +# {{version_number}} 릴리스 요약 + +## 변경 사항 + +- 새로운 기능: [간단한 설명] +- 개선 사항: [간단한 설명] +- 버그 수정: [수정된 버그에 대한 간단한 설명] + +## 상세 변경 로그 + +[이 릴리스에 포함된 커밋 목록 또는 더 상세한 변경 로그 링크] + +--- + +**버전 올림 기준:** `주요 변경 (Major)`: 하위 호환되지 않는 API 변경, `기능 (Minor)`: 하위 호환되는 새로운 기능 추가, `패치 (Patch)`: 하위 호환되는 버그 수정 시 올립니다. + + diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index b216d3b..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Docker CI/CD to GCP - -on: - push: - branches: - - develop - - workflow_dispatch: - -jobs: - build-and-deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Generate application.yml from secret - run: | - mkdir -p src/main/resources - echo "${{ secrets.APP_YML }}" > src/main/resources/application.yml - - - name: Grant execute permission to Gradle wrapper - run: chmod +x ./gradlew - - - name: Build Spring Boot app (JAR) - run: ./gradlew clean build -x test - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push Docker image - run: | - docker build -t ${{ secrets.DOCKER_USERNAME }}/tokkit-server-admin:latest . - docker push ${{ secrets.DOCKER_USERNAME }}/tokkit-server-admin:latest - - - name: SSH to GCP and deploy container - uses: appleboy/ssh-action@v0.1.10 - with: - host: ${{ secrets.SSH_HOST }} - username: ${{ secrets.SSH_USER }} - key: ${{ secrets.SSH_PRIVATE_KEY }} - script: | - docker stop tokkit-server-admin || true - docker rm tokkit-server-admin || true - docker pull ${{ secrets.DOCKER_USERNAME }}/tokkit-server-admin:latest - docker run -d \ - --name tokkit-server-admin \ - -p 8080:8080 \ - --memory=512m \ - --restart always \ - ${{ secrets.DOCKER_USERNAME }}/tokkit-server-admin:latest - diff --git a/.github/workflows/release_note.yml b/.github/workflows/release_note.yml new file mode 100644 index 0000000..8f3e931 --- /dev/null +++ b/.github/workflows/release_note.yml @@ -0,0 +1,26 @@ +name: Tag Release +on: + pull_request: + branches: + - "main" + types: + - closed +jobs: + generate_release: + name: Release + if: contains(github.event.pull_request.head.ref, 'release/v') && github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Fetch version + run: | + VERSION=$(echo "${GITHUB_HEAD_REF}" | sed "s/release\\\\/v//") + echo "version=${VERSION}" >> $GITHUB_OUTPUT + id: fetch-version + - name: Generate release notes + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.ADMIN_GITHUB_TOKEN }} + tag_name: v${{ steps.fetch-version.outputs.version }} + generate_release_notes: true diff --git a/src/main/java/dev/admin/admin/controller/AdminAuthController.java b/src/main/java/dev/admin/admin/controller/AdminAuthController.java index 1569860..28b5654 100644 --- a/src/main/java/dev/admin/admin/controller/AdminAuthController.java +++ b/src/main/java/dev/admin/admin/controller/AdminAuthController.java @@ -10,6 +10,9 @@ import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; + +import org.springframework.beans.factory.annotation.Value; + import org.springframework.http.ResponseCookie; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -22,6 +25,11 @@ public class AdminAuthController { private final AdminAuthCommandService authCommandService; private final JwtUtil jwtUtil; + + @Value("${app.cookie.domain}") + private String cookieDomain; + + @PostMapping("/login") public ApiResponse login(@RequestBody LoginRequestDto requestDto, HttpServletResponse response) { JwtDto tokenDto = authCommandService.login(requestDto); @@ -30,6 +38,7 @@ public ApiResponse login(@RequestBody LoginRequestDto requestDto, HttpSe .httpOnly(true) .secure(true) .path("/") + .domain(cookieDomain) .sameSite("None") .maxAge(60 * 60) .build(); @@ -38,6 +47,7 @@ public ApiResponse login(@RequestBody LoginRequestDto requestDto, HttpSe .httpOnly(true) .secure(true) .path("/") + .domain(cookieDomain) .sameSite("None") .maxAge(7 * 24 * 60 * 60) .build(); @@ -57,6 +67,7 @@ public ApiResponse logout(@CookieValue("refreshToken") String refreshToken .httpOnly(true) .secure(true) .path("/") + .domain(cookieDomain) .sameSite("None") .maxAge(0) .build(); @@ -65,6 +76,7 @@ public ApiResponse logout(@CookieValue("refreshToken") String refreshToken .httpOnly(true) .secure(true) .path("/") + .domain(cookieDomain) .sameSite("None") .maxAge(0) .build();