From 098929febd82ab9b699323cffbc6143e8d8f2753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=B8=EC=A4=80?= Date: Wed, 24 Jul 2024 20:43:22 +0900 Subject: [PATCH 1/8] =?UTF-8?q?fix:=20FileEntity=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/file/entity/FileEntity.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/entity/FileEntity.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/entity/FileEntity.java index 65597fd..eea3614 100644 --- a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/entity/FileEntity.java +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/entity/FileEntity.java @@ -2,21 +2,27 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; import kr.hs.dgsw.SOPO_server_v2.domain.board.entity.BoardEntity; import kr.hs.dgsw.SOPO_server_v2.domain.contest.entity.ContestEntity; +import kr.hs.dgsw.SOPO_server_v2.domain.file.enums.FileCategory; import kr.hs.dgsw.SOPO_server_v2.domain.member.entity.MemberEntity; +import kr.hs.dgsw.SOPO_server_v2.global.common.entity.BaseTimeEntity; import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; @Getter @Entity @Table(name = "tbl_file") @NoArgsConstructor -public class FileEntity { +@SuperBuilder +public class FileEntity extends BaseTimeEntity { // 파일 아이디 @Id @@ -31,6 +37,10 @@ public class FileEntity { @Column(name = "file_url") private String fileUrl; + // 파일 카테고리 + @Enumerated(EnumType.STRING) + private FileCategory fileCategory; + // 게시물 아이디 @ManyToOne @JoinColumn(name = "board_id") From fd08e2a4446bc68e9d52c742e410c1443e12e6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=B8=EC=A4=80?= Date: Wed, 24 Jul 2024 20:43:41 +0900 Subject: [PATCH 2/8] =?UTF-8?q?feat:=20file=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/controller/FileController.java | 27 ++++++++ .../domain/file/dto/FileRes.java | 19 ++++++ .../domain/file/enums/FileCategory.java | 7 ++ .../file/repository/FileRepository.java | 7 ++ .../domain/file/service/FileService.java | 68 +++++++++++++++++++ 5 files changed, 128 insertions(+) create mode 100644 src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/controller/FileController.java create mode 100644 src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/dto/FileRes.java create mode 100644 src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/enums/FileCategory.java create mode 100644 src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/repository/FileRepository.java create mode 100644 src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/service/FileService.java diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/controller/FileController.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/controller/FileController.java new file mode 100644 index 0000000..03fc3ad --- /dev/null +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/controller/FileController.java @@ -0,0 +1,27 @@ +package kr.hs.dgsw.SOPO_server_v2.domain.file.controller; + +import kr.hs.dgsw.SOPO_server_v2.domain.file.dto.FileRes; +import kr.hs.dgsw.SOPO_server_v2.domain.file.enums.FileCategory; +import kr.hs.dgsw.SOPO_server_v2.domain.file.service.FileService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +@RestController +@RequestMapping("/file") +@RequiredArgsConstructor +public class FileController { + private final FileService fileService; + + @PostMapping + public List fileUpload(@RequestParam FileCategory fileCategory, @RequestPart List fileList) { + return fileService.fileUpload(fileCategory, fileList); + } + +} diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/dto/FileRes.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/dto/FileRes.java new file mode 100644 index 0000000..9cd96fd --- /dev/null +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/dto/FileRes.java @@ -0,0 +1,19 @@ +package kr.hs.dgsw.SOPO_server_v2.domain.file.dto; + +import kr.hs.dgsw.SOPO_server_v2.domain.file.entity.FileEntity; +import lombok.Builder; + +@Builder +public record FileRes ( + String fileName, + String fileUrl +) { + + public static FileRes of(FileEntity file) { + return new FileRes( + file.getFileName(), + file.getFileUrl() + ); + } + +} diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/enums/FileCategory.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/enums/FileCategory.java new file mode 100644 index 0000000..674f253 --- /dev/null +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/enums/FileCategory.java @@ -0,0 +1,7 @@ +package kr.hs.dgsw.SOPO_server_v2.domain.file.enums; + +public enum FileCategory { + BOARD, + CONTEST, + PROFILE +} diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/repository/FileRepository.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/repository/FileRepository.java new file mode 100644 index 0000000..60fd7fd --- /dev/null +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/repository/FileRepository.java @@ -0,0 +1,7 @@ +package kr.hs.dgsw.SOPO_server_v2.domain.file.repository; + +import kr.hs.dgsw.SOPO_server_v2.domain.file.entity.FileEntity; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface FileRepository extends JpaRepository { +} diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/service/FileService.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/service/FileService.java new file mode 100644 index 0000000..d830b5a --- /dev/null +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/service/FileService.java @@ -0,0 +1,68 @@ +package kr.hs.dgsw.SOPO_server_v2.domain.file.service; + +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.model.ObjectMetadata; +import com.amazonaws.services.s3.model.PutObjectRequest; +import kr.hs.dgsw.SOPO_server_v2.domain.file.dto.FileRes; +import kr.hs.dgsw.SOPO_server_v2.domain.file.entity.FileEntity; +import kr.hs.dgsw.SOPO_server_v2.domain.file.enums.FileCategory; +import kr.hs.dgsw.SOPO_server_v2.domain.file.repository.FileRepository; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +@Service +@RequiredArgsConstructor +public class FileService { + + @Value("${cloud.aws.s3.bucket}") + private String bucket; + + private final AmazonS3 amazonS3; + + private final FileRepository fileRepository; + + @Transactional + public List fileUpload(FileCategory fileCategory, List fileList) { + List fileLists = new ArrayList<>(); + try { + for (MultipartFile file : fileList) { + String fileName = file.getOriginalFilename(); + + ObjectMetadata metadata = new ObjectMetadata(); + metadata.setContentType(file.getContentType()); + metadata.setContentLength(file.getSize()); + + // S3에 저장하는 코드 + amazonS3.putObject( + new PutObjectRequest(bucket, fileName, file.getInputStream(), metadata) + ); + + // FileRes 형식으로 만들기 + FileRes oneFile = FileRes.builder() + .fileName(fileName) + .fileUrl(amazonS3.getUrl(bucket, fileName).toString()) + .build(); + + fileLists.add(oneFile); + + // DB에 저장하는 코드 + FileEntity fileEntity = FileEntity.builder() + .fileName(fileName) + .fileCategory(fileCategory) + .fileUrl(amazonS3.getUrl(bucket, fileName).toString()) + .build(); + fileRepository.save(fileEntity); + } + } catch (IOException e) { + throw new RuntimeException("Error uploading file to S3", e); + } + return fileLists; + } +} From 8ae7bcf754b8d0897401b12f1b51d0315d13a059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=B8=EC=A4=80?= Date: Wed, 24 Jul 2024 20:44:10 +0900 Subject: [PATCH 3/8] =?UTF-8?q?fix:=20board&contest=20entity=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SOPO_server_v2/domain/board/entity/BoardEntity.java | 6 +++++- .../domain/contest/entity/ContestEntity.java | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/board/entity/BoardEntity.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/board/entity/BoardEntity.java index b9bf40c..b413047 100644 --- a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/board/entity/BoardEntity.java +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/board/entity/BoardEntity.java @@ -13,6 +13,7 @@ import kr.hs.dgsw.SOPO_server_v2.domain.board.dto.BoardUpdateReq; import kr.hs.dgsw.SOPO_server_v2.domain.file.entity.FileEntity; import kr.hs.dgsw.SOPO_server_v2.domain.member.entity.MemberEntity; +import kr.hs.dgsw.SOPO_server_v2.global.common.entity.BaseTimeEntity; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; @@ -24,7 +25,7 @@ @Table(name = "tbl_board") @NoArgsConstructor @SuperBuilder -public class BoardEntity { +public class BoardEntity extends BaseTimeEntity { // 게시물 아이디 @Id @@ -58,4 +59,7 @@ public void update(BoardUpdateReq updateReq) { this.boardContent = updateReq.boardContent(); } + public void likeUpdate(int boardLikeCount) { + this.boardLikeCount += boardLikeCount; + } } diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/contest/entity/ContestEntity.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/contest/entity/ContestEntity.java index 5dff9c1..8b7e2f4 100644 --- a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/contest/entity/ContestEntity.java +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/contest/entity/ContestEntity.java @@ -14,6 +14,7 @@ import kr.hs.dgsw.SOPO_server_v2.domain.contest.enums.ContestState; import kr.hs.dgsw.SOPO_server_v2.domain.file.entity.FileEntity; import kr.hs.dgsw.SOPO_server_v2.domain.member.entity.MemberEntity; +import kr.hs.dgsw.SOPO_server_v2.global.common.entity.BaseTimeEntity; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; @@ -28,7 +29,7 @@ @Table(name = "tbl_contest") @NoArgsConstructor @SuperBuilder -public class ContestEntity { +public class ContestEntity extends BaseTimeEntity { // 대회 아이디 @Id @@ -80,4 +81,9 @@ public void update(ContestUpdateReq updateReq) { this.contestPerson = updateReq.contestPerson(); this.contestDateTime = updateReq.contestDateTime(); } + + public void likeUpdate(int contestLikeCount) { + this.contestLikeCount += contestLikeCount; + } + } From 29de0546ca48426c175f326add3b5939b797de81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=B8=EC=A4=80?= Date: Wed, 24 Jul 2024 20:44:31 +0900 Subject: [PATCH 4/8] =?UTF-8?q?feat:=20S3Config=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/config/S3Config.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/kr/hs/dgsw/SOPO_server_v2/global/config/S3Config.java diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/global/config/S3Config.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/global/config/S3Config.java new file mode 100644 index 0000000..93ab5ea --- /dev/null +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/global/config/S3Config.java @@ -0,0 +1,32 @@ +package kr.hs.dgsw.SOPO_server_v2.global.config; + +import com.amazonaws.auth.AWSStaticCredentialsProvider; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.AmazonS3ClientBuilder; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class S3Config { + + @Value("${cloud.aws.credentials.accessKey}") + private String accessKey; + + @Value("${cloud.aws.credentials.secretKey}") + private String secretKey; + + @Value("${cloud.aws.region.static}") + private String region; + + @Bean + public AmazonS3 amazonS3Client() { + BasicAWSCredentials awsCredentials = new BasicAWSCredentials(accessKey, secretKey); + return AmazonS3ClientBuilder.standard() + .withRegion(region) + .enablePathStyleAccess() + .withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) + .build(); + } +} From 9e203900897f2fa8cc498fe228209895dbfd3417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=B8=EC=A4=80?= Date: Thu, 25 Jul 2024 08:38:25 +0900 Subject: [PATCH 5/8] =?UTF-8?q?fix:=20StatusEnum=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SOPO_server_v2/global/error/exception/StatusEnum.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/global/error/exception/StatusEnum.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/global/error/exception/StatusEnum.java index fd91d16..c90a07c 100644 --- a/src/main/java/kr/hs/dgsw/SOPO_server_v2/global/error/exception/StatusEnum.java +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/global/error/exception/StatusEnum.java @@ -47,7 +47,13 @@ public enum StatusEnum { //fcm MESSAGE_SEND_FAILED(403,"Message send failed"), TOKEN_NOT_PROVIDED(400, "잘못된 토큰"), - CLOUD_EXCEPTION(500,"클라우드 에러") + CLOUD_EXCEPTION(500,"클라우드 에러"), + + // board + BOARD_NOT_FOUND(404, "Board not found"), + + // contest + CONTEST_NOT_FOUND(404, "Contest not found") ; private final int statusCode; From 3a827a6e10c4b2f447e573948a288edcf556b913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=B8=EC=A4=80?= Date: Thu, 25 Jul 2024 10:36:44 +0900 Subject: [PATCH 6/8] =?UTF-8?q?fix:=20File=20=EB=B6=80=EB=B6=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/file/controller/FileController.java | 4 ++-- .../SOPO_server_v2/domain/file/service/FileService.java | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/controller/FileController.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/controller/FileController.java index 03fc3ad..68a07ea 100644 --- a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/controller/FileController.java +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/controller/FileController.java @@ -3,6 +3,7 @@ import kr.hs.dgsw.SOPO_server_v2.domain.file.dto.FileRes; import kr.hs.dgsw.SOPO_server_v2.domain.file.enums.FileCategory; import kr.hs.dgsw.SOPO_server_v2.domain.file.service.FileService; +import kr.hs.dgsw.SOPO_server_v2.global.response.ResponseData; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -20,8 +21,7 @@ public class FileController { private final FileService fileService; @PostMapping - public List fileUpload(@RequestParam FileCategory fileCategory, @RequestPart List fileList) { + public ResponseData> fileUpload(@RequestParam FileCategory fileCategory, @RequestPart List fileList) { return fileService.fileUpload(fileCategory, fileList); } - } diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/service/FileService.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/service/FileService.java index d830b5a..4a45c8f 100644 --- a/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/service/FileService.java +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/domain/file/service/FileService.java @@ -7,8 +7,10 @@ import kr.hs.dgsw.SOPO_server_v2.domain.file.entity.FileEntity; import kr.hs.dgsw.SOPO_server_v2.domain.file.enums.FileCategory; import kr.hs.dgsw.SOPO_server_v2.domain.file.repository.FileRepository; +import kr.hs.dgsw.SOPO_server_v2.global.response.ResponseData; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; @@ -29,7 +31,7 @@ public class FileService { private final FileRepository fileRepository; @Transactional - public List fileUpload(FileCategory fileCategory, List fileList) { + public ResponseData> fileUpload(FileCategory fileCategory, List fileList) { List fileLists = new ArrayList<>(); try { for (MultipartFile file : fileList) { @@ -50,6 +52,7 @@ public List fileUpload(FileCategory fileCategory, List f .fileUrl(amazonS3.getUrl(bucket, fileName).toString()) .build(); + fileLists.add(oneFile); // DB에 저장하는 코드 @@ -63,6 +66,6 @@ public List fileUpload(FileCategory fileCategory, List f } catch (IOException e) { throw new RuntimeException("Error uploading file to S3", e); } - return fileLists; + return ResponseData.of(HttpStatus.OK, "파일 업로드 완료", fileLists); } } From f9493e7c32499003ed387be9c097d2164416fa36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=B8=EC=A4=80?= Date: Thu, 25 Jul 2024 15:03:16 +0900 Subject: [PATCH 7/8] =?UTF-8?q?fix:=20StatusEnum=20=EB=B6=80=EB=B6=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SOPO_server_v2/global/error/exception/StatusEnum.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/kr/hs/dgsw/SOPO_server_v2/global/error/exception/StatusEnum.java b/src/main/java/kr/hs/dgsw/SOPO_server_v2/global/error/exception/StatusEnum.java index c90a07c..fd91d16 100644 --- a/src/main/java/kr/hs/dgsw/SOPO_server_v2/global/error/exception/StatusEnum.java +++ b/src/main/java/kr/hs/dgsw/SOPO_server_v2/global/error/exception/StatusEnum.java @@ -47,13 +47,7 @@ public enum StatusEnum { //fcm MESSAGE_SEND_FAILED(403,"Message send failed"), TOKEN_NOT_PROVIDED(400, "잘못된 토큰"), - CLOUD_EXCEPTION(500,"클라우드 에러"), - - // board - BOARD_NOT_FOUND(404, "Board not found"), - - // contest - CONTEST_NOT_FOUND(404, "Contest not found") + CLOUD_EXCEPTION(500,"클라우드 에러") ; private final int statusCode; From 550d1c357f40a68b8eb70d03dd9e31c0d8756ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EA=B0=80=EC=98=81?= Date: Sat, 27 Jul 2024 01:31:11 +0900 Subject: [PATCH 8/8] ci: modify actions --- .github/workflows/main.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f346fd6..52ad4f4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,9 +48,16 @@ jobs: docker rmi ${{ secrets.DOCKER_USERNAME }}/sopo_v2 || true docker pull ${{ secrets.DOCKER_USERNAME }}/sopo_v2 docker run -d -p 8080:8080 --name sopo_v2 ${{ secrets.DOCKER_USERNAME }}/sopo_v2 - - docker stop redis || true - docker rm redis || true - docker rmi redis || true - docker pull redis:latest - docker run -d --name redis -p 6379:6379 redis:latest \ No newline at end of file + + mkdir -p /home/ubuntu/app + cd /home/ubuntu/app + + # 기존 docker-compose.yml 파일을 덮어쓰거나 생성 + echo "${{ secrets.DOCKER_COMPOSE }}" > docker-compose.yml + + # Docker Compose 명령어 실행 + docker-compose pull + docker-compose up -d + + # 사용하지 않는 Docker 데이터 정리 (선택 사항) + docker system prune -f \ No newline at end of file