Skip to content

Commit

Permalink
Merge branch 'dev' into feat#11-Create-Casper-Bot
Browse files Browse the repository at this point in the history
  • Loading branch information
k000927 authored Jul 30, 2024
2 parents ecaacd3 + 61278f2 commit cfd48e9
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 22 deletions.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

## 🖥️ 어떤 버그인가요?

## ❗️ 참고 자료 (선택)
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

## 🖥️ 어떤 기능인가요?

## ✏️ 작업 상세 내용

## ❗️ 참고 자료 (선택)
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## 🖥️ Preview

close #{issue number}

## ✏️ 한 일

## ❗️ 발생한 이슈 (해결 방안)

## ❓ 논의가 필요한 사항
66 changes: 66 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Deploy to EC2 with Docker Compose

on:
pull_request:
branches:
- dev

env:
AWS_REGION: ap-northeast-2
DOCKER_HUB_REPOSITORY: baeeejw/jgs-spring-boot
working-directory: ./Server

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: JDK 17 설치
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'

- name: gradlew에 실행 권한 부여
run: chmod +x gradlew
working-directory: ${{ env.working-directory }}

- name: 프로젝트 빌드
run: ./gradlew clean build -x test
working-directory: ${{ env.working-directory }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build and push Docker image
run: |
docker buildx build --push --tag ${{ env.DOCKER_HUB_REPOSITORY }}:latest .
working-directory: ${{ env.working-directory }}

- name: SSH into EC2 and deploy with Docker Compose
uses: appleboy/[email protected]
with:
host: ${{ secrets.EC2_HOST }}
username: ubuntu
key: ${{ secrets.EC2_SECRET }}
script: |
cd /home/ubuntu/spring-boot
docker-compose pull
docker-compose up -d
60 changes: 40 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,46 @@ docs: 문서 작성
### 폴더 구조

```jsx
└── src
├── apis
│ └── badgeAPI.ts
├── components
│ └── Header
│ └── index.tsx
├── constants
│ └── log.ts
│ └── color.ts
├── contexts
│ └── badgeContext.tsx
├── hooks
│ └── useFetch.tsx
├── pages
│ └── Main
│ └── index.tsx
├── types
│ └── badge.ts
└── utils
└── badge.ts
.
├── main
│   ├── java
│   │   └── JGS
│   │   └── CasperEvent
│   │   ├── domain
│   │   │   ├── event
│   │   │   │   ├── controller
│   │   │   │   │   ├── adminController
│   │   │   │   │   └── eventController
│   │   │   │   ├── dto
│   │   │   │   ├── entity
│   │   │   │   │   ├── admin
│   │   │   │   │   ├── casperBot
│   │   │   │   │   │   └── casperEnum
│   │   │   │   │   ├── event
│   │   │   │   │   └── participants
│   │   │   │   ├── repository
│   │   │   │   │   ├── eventRepository
│   │   │   │   │   └── participantsRepository
│   │   │   │   └── service
│   │   │   │   ├── AdminService
│   │   │   │   └── eventService
│   │   │   ├── health
│   │   │   │   └── api
│   │   │   └── url
│   │   │   ├── controller
│   │   │   ├── entity
│   │   │   ├── repository
│   │   │   └── service
│   │   └── global
│   │   ├── entity
│   │   ├── error
│   │   └── response
│   └── resources
└── test
└── java
└── JGS
└── CasperEvent
└── LotteryEventTests
```

### 커밋 템플릿
Expand Down
7 changes: 7 additions & 0 deletions Server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM amazoncorretto:17
# FROM openjdk:17-jdk
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} jgs-spring-boot.jar
# COPY build/libs/*.jar my-project.jar
ENTRYPOINT ["java","-jar","/jgs-spring-boot.jar"]
RUN ln -snf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
3 changes: 1 addition & 2 deletions Server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ dependencies {

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'


implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
}

tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package JGS.CasperEvent.global.config;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {
@Bean
public OpenAPI openAPI() {
return new OpenAPI()
.components(new Components())
.info(apiInfo());
}

private Info apiInfo() {
return new Info()
.title("API Test") // API의 제목
.description("Let's practice Swagger UI") // API에 대한 설명
.version("1.0.0"); // API의 버전
}
}

0 comments on commit cfd48e9

Please sign in to comment.