Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[deploy] main CI/CD 확인 #41

Merged
merged 22 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a119a2f
[#1] feat: 프로젝트 초기 세팅 (#2)
hyerinhwang-sailin Jan 1, 2025
54cb6dc
[#4] rename: napjak -> napzak으로 rename (#5)
hyerinhwang-sailin Jan 7, 2025
e8227ca
[feat] #3 - 카카오 소셜 로그인 환경 + Member 도메인 로그인 기능 구현 (#7)
sae2say Jan 14, 2025
b331729
[#8] feat - CI/CD 구성 (#10)
hyerinhwang-sailin Jan 14, 2025
de2003f
[feat] #8 - Dockerfile 수정 (#11)
hyerinhwang-sailin Jan 14, 2025
75db86f
[fix] #12 - workflow 수정 (#13)
hyerinhwang-sailin Jan 14, 2025
ac48d03
[#12] fix(*-CD): cd env 지정 (#16)
hyerinhwang-sailin Jan 14, 2025
d28277f
[#17] fix(dev-CD): 환경변수 이름 수정 (#18)
hyerinhwang-sailin Jan 14, 2025
54c5d42
[refactor] #19 - 빌드 속도 개선 (#20)
hyerinhwang-sailin Jan 14, 2025
3113ea2
[#21] refactor(Dockerfile-*): 명령어 수정 (#22)
hyerinhwang-sailin Jan 14, 2025
d93b37e
[#23] refactor: 명령어 수정 (#24)
hyerinhwang-sailin Jan 14, 2025
1ee3e76
[refactor] #25 - ci/cd 방식 변경 (#26)
hyerinhwang-sailin Jan 14, 2025
b9b4546
[refactor] #25 - 명령어 오타 수정 (#27)
hyerinhwang-sailin Jan 14, 2025
2cbb90e
[#28] fix: jar 파일 이름 변경 (#29)
hyerinhwang-sailin Jan 14, 2025
76fa5d0
[fix] #28 - jar 파일 이름 변경 (#30)
hyerinhwang-sailin Jan 14, 2025
b0aac0d
[refactor] #31 - 배포 방식 변경 (#32)
hyerinhwang-sailin Jan 14, 2025
919ad1f
[refactor] #31 - docker-compose 지정 (#33)
hyerinhwang-sailin Jan 14, 2025
ad3cb94
[refactor] #31 - deploy.sh 추가 (#34)
hyerinhwang-sailin Jan 14, 2025
3972d98
[revert] #35 pr
hyerinhwang-sailin Jan 14, 2025
debc454
[refactor] #36 - deploy.sh 추가
hyerinhwang-sailin Jan 14, 2025
a4758b7
[fix] #38 - docker-compose 변경 (#39)
hyerinhwang-sailin Jan 15, 2025
8a5f0b4
[refactor] #42 - CICD 실행 조건 구체화 (#43)
hyerinhwang-sailin Jan 15, 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
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build/
.gradle/
*.iml
.idea/
.vscode/
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: bug
about: Create a report to help us improve
title: "[bug] [name]"
labels: ''
assignees: ''

---

## Bug/Fix Issue 📌

<!-- 해야하는 일과 이 일을 해야하는 이유를 적어주세요 -->

<br>

## Todo ✔️

- [ ] N/A
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: feature
about: Suggest an idea for this project
title: "[feat] [issue name]"
labels: ''
assignees: ''

---

## Feature Issue 📌

<!-- 해야하는 일과 이 일을 해야하는 이유를 적어주세요 -->

<br>

## Todo ✔️

- [ ] N/A
25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Related issue 🛠

<!-- 관련 이슈 번호를 적어주세요 -->

- closes #번호

## Work Description ✏️

<!-- 작업 내용을 간단히 소개주세요 -->

## Trouble Shooting ⚽️

<!-- 어떤 위험이나 장애를 발견했는지 적어주세요 -->

## Related ScreenShot 📷

<!-- 관련 스크린샷을 첨부해주세요 -->

## Uncompleted Tasks 😅

<!-- 끝내지 못한 작업을 적어주세요 -->

## To Reviewers 📢

<!-- 리뷰어들에게 물어볼 점, 할 말 등을 적어주세요 -->
40 changes: 40 additions & 0 deletions .github/relases-drafter-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🎯 새로운 기능이 추가되었어요'
labels: [ 'feat 🎯' ]
- title: '🛠️ 기존 버그가 수정되었어요'
labels:
- 'fix 🛠️'
- 'HOTFIX 🚑'
- title: '🐬 코드를 개선했어요'
labels:
- 'refactor 🔁'
- 'test 🧪'
- 'chore 🔍'
- title: '⚙️ 프로젝트를 개선했어요'
labels:
- 'rename 📛'
- 'remove 👻'
- 'docs ✍🏻'
- title: '🚀 배포'
labels:
- 'deploy 🚀'

change-template: '- $TITLE #$NUMBER @$AUTHOR '
template: |
## 이번 버전의 변경사항은 아래와 같아요
---
$CHANGES
no-changes-template: '변경사항이 없어요'
version-resolver:
major:
labels:
- '1️⃣ major'
minor:
labels:
- '2️⃣ minor'
patch:
labels:
- '3️⃣ patch'
default: patch
75 changes: 75 additions & 0 deletions .github/workflows/dev-CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: dev-CD

on:
push:
branches:
- develop
branches-ignore:
- main

jobs:
CI:
runs-on: ubuntu-22.04
environment: dev

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

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

- name: Create secret config file
run: |
cd src/main/resources
echo "${{ secrets.APPLICATION_DEV }}" > ./application-dev.yml

- name: Build with Gradle
run: |
chmod +x gradlew
./gradlew clean build -x test

- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DEV_DOCKERHUB_USERNAME }}
password: ${{ secrets.DEV_DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile-dev
push: true
tags: ${{ secrets.DEV_DOCKERHUB_USERNAME }}/${{ secrets.DEV_REPONAME }}:latest

CD:
needs: [CI]
runs-on: ubuntu-22.04
environment: dev

steps:
- name: Docker Image Pull and Run
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEV_SERVER_HOST }}
username: ${{ secrets.DEV_SERVER_USERNAME }}
key: ${{ secrets.DEV_SERVER_KEY }}
script: |
bash /home/ubuntu/35-APPJAM-SERVER-NAPZAKMARKET/deploy.sh
33 changes: 33 additions & 0 deletions .github/workflows/dev-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: dev-CI

on:
pull_request:
branches:
- develop
branches-ignore:
- main

jobs:
build:
runs-on: ubuntu-22.04
environment: dev

steps:
- name: Checkout
uses: actions/checkout@v3

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

- name: create secret config file
run: |
cd src/main/resources
echo "${{ secrets.APPLICATION_DEV }}" > ./application-dev.yml

- name: build with gradle
run: |
chmod +x gradlew
./gradlew clean build -x test
72 changes: 72 additions & 0 deletions .github/workflows/prod-CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: prod-CD

on:
push:
- main

jobs:
CI:
runs-on: ubuntu-22.04
environment: prod

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

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

- name: create secret config file
run: |
cd src/main/resources
echo "${{ secrets.APPLICATION_PROD }}" > ./application-prod.yml

- name: build with gradle
run: |
chmod +x gradlew
./gradlew clean build -x test

- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.PROD_DOCKERHUB_USERNAME }}
password: ${{ secrets.PROD_DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile-prod
push: true
tags: ${{ secrets.PROD_DOCKERHUB_USERNAME }}/${{ secrets.PROD_REPONAME }}:latest

CD:
needs: [CI]
runs-on: ubuntu-22.04
environment: prod

steps:
- name: Docker Image Pull and Container Run
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PROD_SERVER_HOST }}
username: ${{ secrets.PROD_SERVER_USERNAME }}
key: ${{ secrets.PROD_SERVER_KEY }}
script: |
bash /home/ubuntu/35-APPJAM-SERVER-NAPZAKMARKET/deploy.sh
31 changes: 31 additions & 0 deletions .github/workflows/prod-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: prod-CI

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-22.04
environment: prod

steps:
- name: Checkout
uses: actions/checkout@v3

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

- name: create secret config file
run: |
cd src/main/resources
echo "${{ secrets.APPLICATION_PROD }}" > ./application-prod.yml

- name: build with gradle
run: |
chmod +x gradlew
./gradlew clean build -x test
14 changes: 14 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Release Drafter
on:
push:
branches:
- main
jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
with:
config-name: release-drafter-config.yml
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
Loading