Skip to content

Commit

Permalink
Merge pull request #74 from SMWU-POCHAK/develop
Browse files Browse the repository at this point in the history
1.0.3 버전 배포
  • Loading branch information
5jisoo authored Sep 30, 2024
2 parents f7772da + 24a5af8 commit 99fbab7
Show file tree
Hide file tree
Showing 68 changed files with 1,637 additions and 393 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug report
about: Bug 해결을 도와주세요!
title: "[BUG]"
labels: "\U0001F41C bug"
labels: ''
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Feature 작업 사항을 입력해주세요!
title: "[FEAT]"
labels: "\U0001F4ABfeature"
labels: ''
assignees: ''

---
Expand Down
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/refactor_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Refactor request
about: 기존 기능을 개선하거나 리팩토링합니다
title: "[Refactor]"
labels: "\U0001F527 refactor"
assignees: ''

---

## 📍 개선한 기능
- 개선한 기능에 대한 설명

## 🛠 개선 작업 내용
- [ ] todo1
- [ ] todo2
- [ ] todo3

## 📢 추가 의논 사항
- 추가적으로 의논할 사항이나 발생한 에러에 대한 설명

## 🚨 주의 사항
- 구현하며 발견한 주의 사항이나 **꼭 확인했으면 하는 로직**에 대한 설명
8 changes: 4 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

## 📍 Issue 번호

> #n
- #n

- n에 작업 번호를 작성해주세요!
<!-- n에 작업 번호를 작성해주세요! -->

## 🛠️ 작업사항

- 내용을 적어주세요.
- [ ] 내용을 적어주세요.

## 🧰 변경로직
## 🧰 추가 논의사항

- 내용을 적어주세요.
67 changes: 67 additions & 0 deletions .github/workflows/dev-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: dev server

on:
push:
branches: [ develop ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: "corretto"

- name: Set up COMMON file
run: echo "${{ secrets.COMMON }}" > ./src/main/resources/application-COMMON.properties
shell: bash

- name: Set up DEV file
run: echo "${{ secrets.DEV }}" > ./src/main/resources/application-DEV.properties
shell: bash

- name: Set up Firebase Key file
run: echo "${{ secrets.FIREBASE_KEY }}" > ./src/main/resources/static/firebase-adminsdk.json
shell: bash

- name: Set up Apple Key file
run: echo "${{ secrets.APPLE_AUTH_KEY }}" > ./src/main/resources/static/AuthKey_ZJ4VQZNW7D.p8
shell: bash

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash

- name: Build with Gradle
run: ./gradlew clean build
shell: bash

- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_DEV_USERNAME }}
password: ${{ secrets.DOCKERHUB_DEV_PWD }}

- name: Build and push Docker images
uses: docker/[email protected]
with:
context: .
file: Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_DEV_USERNAME }}/pochak-dev
build-args: |
SPRING_PROFILES_ACTIVE=DEV
- name: Execute remote ssh & Deploy Dev server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_DEV_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: sudo sh deploy.sh
67 changes: 67 additions & 0 deletions .github/workflows/prod-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: prod server

on:
push:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: "corretto"

- name: Set up COMMON file
run: echo "${{ secrets.COMMON }}" > ./src/main/resources/application-COMMON.properties
shell: bash

- name: Set up PROD file
run: echo "${{ secrets.PROD }}" > ./src/main/resources/application-PROD.properties
shell: bash

- name: Set up Firebase Key file
run: echo "${{ secrets.FIREBASE_KEY }}" > ./src/main/resources/static/firebase-adminsdk.json
shell: bash

- name: Set up Apple Key file
run: echo "${{ secrets.APPLE_AUTH_KEY }}" > ./src/main/resources/static/AuthKey_ZJ4VQZNW7D.p8
shell: bash

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash

- name: Build with Gradle
run: ./gradlew clean build
shell: bash

- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_PROD_USERNAME }}
password: ${{ secrets.DOCKERHUB_PROD_PWD }}

- name: Build and push Docker images
uses: docker/[email protected]
with:
context: .
file: Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_PROD_USERNAME }}/pochak-prod
build-args: |
SPRING_PROFILES_ACTIVE=PROD
- name: Execute remote ssh & Deploy Prod server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_PROD_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: sudo sh deploy.sh
14 changes: 4 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,20 @@ src/main/resources/static/docs/

# ignore key file
AuthKey_D5ZQTHUQ4K.p8
AuthKey_ZJ4VQZNW7D.p8
firebase-adminsdk.json

# ignore properties file
application-LAMBDA.properties
application-API-KEY.properties
application-ES.properties
application-OAUTH.properties
application-JWT.properties
application-TEST.properties
application-COMMON.properties
application-DEV.properties
application-PROD.properties

# deploy
.tar
application-API-KEY.tar
application-OAUTH.tar
application-JWT.tar

AuthKey_D5ZQTHUQ4K.p8
AuthKey_D5ZQTHUQ4K.tar


### STS ###
.apt_generated
.classpath
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ FROM openjdk:17-jdk
WORKDIR /app
COPY build/libs/*.jar app.jar
EXPOSE 3000
ENV SPRING_PROFILES_ACTIVE=DEV

CMD ["java", "-jar", "-Duser.timezone=Asia/Seoul", "app.jar"]
CMD java -jar -Duser.timezone=Asia/Seoul app.jar
39 changes: 29 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,46 @@

## STACK

> CI/CD
- DB `MySQL`
- Host
- GCP `Computing Engine` `Cloud SQL` `Cloud DNS`
- AWS `S3`
- `Ubuntu 20.04.6 LTS` `nginx/1.18.0 (Ubuntu)`
- `Docker version 27.1.2`
- CI/CD `GitHub Actions` `Jenkins Version 2.473`
- Framework `Spring Boot 3.2.1 (Java 17)`
- Authentication `JWT`
- API Document `Spring REST Docs`

- GitHub Actions
- AWS CodeDeploy, EC2, S3
<!-- 아키텍처 사진 넣기 -->

<!--
## ERD
> ERD 사진 넣기
-->

## Team Rule

[![GitHub](https://img.shields.io/badge/github%20convention-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://smwu-pochak.github.io/posts/server-team-rule/)

> INFRA

- GCP Computing Engine, Cloud SQL, Cloud DNS
- Nginx
- Spring Boot 3.2.1 (Java 17)
- Spring Data JPA
- MySQL

## Contributors

> 최신순 `(2차 → 1차)` 으로 나열되어 있습니다.

<table>
<tr>
<td align="center" valign="top" width="33%"><a href="https://github.com/5jisoo"><img src="https://avatars.githubusercontent.com/u/96935231?v=4" ></a></td>
<td align="center" valign="top" width="33%"><a href="https://github.com/dudrhy12"><img src="https://avatars.githubusercontent.com/u/90203803?v=4" ></a></td>
<td align="center" valign="top" width="33%"><a href="https://github.com/yeahjinjeong"><img src="https://avatars.githubusercontent.com/u/88896562?v=4" ></a></td>
</tr>
<tr>
<td align="center" valign="top"><a href = "https://github.com/5jisoo">오지수 Lucy Oh</a><br>Backend Developer</td>
<td align="center" valign="top"><a href = "https://github.com/dudrhy12">조영서 Bella Cho</a><br>Backend Developer</td>
<td align="center" valign="top"><a href = "https://github.com/yeahjinjeong">정예진 Yejin Jeong</a><br>Backend Developer</td>
</tr>
<tr>
<td valign="top"> <!-- 지수 -->
Expand Down Expand Up @@ -103,6 +118,10 @@
</ul>
</li>
</ul>
</td>
<td valign="top"> <!-- 예진 -->
<ul>
</ul>
</td>

</tr>
Expand Down
Loading

0 comments on commit 99fbab7

Please sign in to comment.