Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
75a2653
setting: 의존성 제거
wjkim9 Aug 8, 2025
5be86ed
Merge branch 'dev' into feat/match
wjkim9 Aug 8, 2025
6988df8
feat: 드래프트 생성 및 페이지 이동 구현
wjkim9 Aug 11, 2025
62c0092
Merge branch 'dev' into feat/match
wjkim9 Aug 11, 2025
20e9358
Merge branch 'dev' into feat/match
wjkim9 Aug 11, 2025
bacb7a2
feat: 통합 후 수정 중
wjkim9 Aug 11, 2025
d230218
Merge branch 'dev' into feat/match
wjkim9 Aug 11, 2025
6736c45
Merge branch 'dev' into feat/match
wjkim9 Aug 11, 2025
ccc5085
선수리스트 REDIS와 연동 및 elasticsearch를 이용한 검색 기능 개발
hwichoi0317 Aug 11, 2025
9c679e9
Redis설정 변경(문자열 직렬화 설정 (key, value 모두) -> value (역)직렬화 설정은 문자열이 아닌 Obj…
hwichoi0317 Aug 11, 2025
85143cf
Merge branch 'dev' into feature/#43
hwichoi0317 Aug 11, 2025
03f4544
선수 검색 기능 관련 수정
hwichoi0317 Aug 12, 2025
a836dbb
Merge branch 'dev' into feature/#43
hwichoi0317 Aug 12, 2025
b8b5f70
Merge branch 'dev' into feature/#43
hwichoi0317 Aug 13, 2025
3619842
feat: 드래프트 생성 기능 구현
wjkim9 Aug 13, 2025
a574bdd
Merge branch 'dev' into feat/match
wjkim9 Aug 13, 2025
8256282
Merge branch 'main' into feat/match
wjkim9 Aug 13, 2025
4f95a5e
선수 리스트 관련 수정(선수상태(status)와 elementTypeId(포지션pk값) 요소로 추가)
hwichoi0317 Aug 13, 2025
8c3b1ea
Merge pull request #57 from MLB-FPL/feature/#43
hwichoi0317 Aug 13, 2025
8510a96
Merge pull request #58 from MLB-FPL/feat/match
wjkim9 Aug 13, 2025
92d90e6
Create deploy.yml
roode1017 Aug 14, 2025
58866df
선수 검색 관련 수정 및 포지션 리스트 가져오는 로직 추가
hwichoi0317 Aug 14, 2025
f958008
Merge branch 'dev' into feature/#43
hwichoi0317 Aug 14, 2025
092ae56
feat/ 배포를 위한 docker 추가 및 securityconfig 파일 수정, healthcheck를 위한 contro…
roode1017 Aug 14, 2025
5751e4e
Merge remote-tracking branch 'origin/feat/#59' into feat/#59
roode1017 Aug 14, 2025
8b7e888
Merge pull request #61 from MLB-FPL/feat/#59
roode1017 Aug 14, 2025
ee60d4b
Merge branch 'dev' into feature/#43
hwichoi0317 Aug 14, 2025
e8a0600
Merge pull request #63 from MLB-FPL/feature/#43
hwichoi0317 Aug 14, 2025
1bab887
hotfix/ deploy 퍄일 수정
roode1017 Aug 14, 2025
591acf0
Merge pull request #65 from MLB-FPL/hotfix/#64
roode1017 Aug 14, 2025
6f1d51a
Merge branch 'main' into dev
roode1017 Aug 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Deploy to Amazon Linux EC2 (compose-prod)

on:
push:
branches: [ main ] # main 브랜치 푸시 시 배포
workflow_dispatch: {}

jobs:
deploy:
runs-on: ubuntu-latest

steps:
# 1) 코드 체크아웃
- name: Checkout
uses: actions/checkout@v4

# 2) JDK 설치 (Spring 빌드)
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

# 3) Gradle 빌드 (테스트 생략 예시)
- name: Build Spring Boot
run: ./gradlew clean build -x test

# 4) EC2로 파일 전송
# - compose 파일: docker-compose-prod.yml
# - backendProject 폴더 안의 Dockerfile
# - CI에서 생성한 JAR (backendProject/build/libs/*.jar)
# - (있다면) .env
- name: Upload artifacts to EC2
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
source: |
docker-compose-prod.yml
backendProject/Dockerfile
backendProject/build/libs/*.jar
.env
target: ${{ secrets.EC2_APP_DIR }}

# 5) EC2에서 배포 (Amazon Linux)
- name: Deploy on EC2
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
set -e
APP_DIR="${{ secrets.EC2_APP_DIR }}"
cd "$APP_DIR"

# Docker/compose 설치(없을 때)
if ! command -v docker >/dev/null 2>&1; then
if command -v dnf >/dev/null 2>&1; then
sudo dnf -y update
sudo dnf -y install docker
else
sudo yum -y update
sudo yum -y install docker
fi
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker $USER || true
fi
if ! docker compose version >/dev/null 2>&1; then
if command -v dnf >/dev/null 2>&1; then
sudo dnf -y install docker-compose-plugin
else
sudo yum -y install docker-compose-plugin || true
fi
fi

# 기존 컨테이너 중지 후 재빌드/재기동
sudo docker compose -f docker-compose-prod.yml down || true
sudo docker compose -f docker-compose-prod.yml build --no-cache
sudo docker compose -f docker-compose-prod.yml up -d

# (옵션) 안 쓰는 이미지 정리
sudo docker image prune -f

# 6) (선택) CloudFront 캐시 무효화
- name: Configure AWS credentials
if: ${{ secrets.CF_DISTRIBUTION_ID != '' }}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Invalidate CloudFront
if: ${{ secrets.CF_DISTRIBUTION_ID != '' }}
run: |
aws cloudfront create-invalidation \
--distribution-id "${{ secrets.CF_DISTRIBUTION_ID }}" \
--paths "/*"
2 changes: 1 addition & 1 deletion backendProject/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dependencies {

/* ElasticSearch */
implementation 'org.springframework.boot:spring-boot-starter-data-elasticsearch'
implementation 'co.elastic.clients:elasticsearch-java:8.13.0'
//implementation 'co.elastic.clients:elasticsearch-java:8.13.0'

/* JSONObject */
implementation 'org.json:json:20240303'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ public class Draft {
@Column(name = "id", nullable = false)
private UUID id;

@Column(name = "room_no", nullable = false)
private long roomNo;
@Column(name = "room_no", nullable = false, updatable = false, insertable = false)
@org.hibernate.annotations.Generated(org.hibernate.annotations.GenerationTime.INSERT)
private Long roomNo;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package likelion.mlb.backendProject.domain.match.controller;

import likelion.mlb.backendProject.domain.match.dto.AssignDto;
import likelion.mlb.backendProject.domain.match.service.AssignmentService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

@RestController
@RequestMapping("/api/match")
@RequiredArgsConstructor
public class AssignmentController {

private final AssignmentService assignmentService;

@GetMapping("/assignment")
public ResponseEntity<AssignDto> getAssignment(
//@AuthenticationPrincipal CustomUser principal // FIXME: 실제 타입으로

) {
//UUID userId = principal.getId(); // 로그인 유저 PK
UUID userId = UUID.fromString("969a6b7d-2a24-41ca-9f46-d1d2f8012844"); // FIXME 수정할 것
AssignDto dto = assignmentService.getMyAssignmentOrThrow(userId); // 없으면 BaseException 던짐
return ResponseEntity.ok(dto);
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package likelion.mlb.backendProject.domain.match.dto;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.UUID;

@Getter
@AllArgsConstructor
public class AssignDto {
private UUID draftId;
private short userNumber;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package likelion.mlb.backendProject.domain.match.dto;

import lombok.*;

import java.util.UUID;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class DraftStartMessage {
private String type; // "DRAFT_START"
private UUID draftId;
private short userNumber; // 1~4
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Participant {
private short userNumber;

@Column(name = "isDummy", nullable = false)
private boolean isDummy;
private boolean dummy;

@Column(name = "score", nullable = false)
private Integer score = 0;
Expand Down
Loading