Skip to content

Commit

Permalink
init : github workflows 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ImNM committed Dec 30, 2022
1 parent de67860 commit 7e5947e
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ImNM @sanbonai06 @cofls6581 @gengminy @kim-wonjin
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## 개요
- close #issueNumber

## 작업사항
- 내용을 적어주세요.

## 변경로직
- 내용을 적어주세요.
53 changes: 53 additions & 0 deletions .github/workflows/BuildApiServer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build Api Server
on:
push:
tags:
- Api-v*.*.*

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 17 ]
outputs:
version: ${{ steps.get_version.outputs.BRANCH_NAME }}

steps:
- name: Check Out The Repository
uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java-version }}
distribution: 'corretto'

- name: Get the version
id: get_version
run: |
RELEASE_VERSION_WITHOUT_V="$(cut -d'v' -f2 <<< ${GITHUB_REF#refs/*/})"
echo ::set-output name=VERSION::$RELEASE_VERSION_WITHOUT_V
- name: Gradle Build
uses: gradle/gradle-build-action@v2
with:
arguments: |
build --no-daemon
build-root-directory: DuDung-Api

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

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./DuDung-Api
push: true
tags: water0641/dudung-api:${{ steps.get_version.outputs.VERSION }}

32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: ci
on:
pull_request:
branch: 'dev'

jobs:
spotlessJavaCheck:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: SetUp JDK 17
uses: actions/setup-java@v2
with:
java-version: "17"
distribution: 'adopt'

- name: Gradle Caching
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: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Run build
run: ./gradlew build -x test
9 changes: 9 additions & 0 deletions DuDung-Api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM openjdk:17-alpine

EXPOSE 8080

COPY ./build/libs/*.jar app.jar
ARG PROFILE=prod
ENV PROFILE=${PROFILE}

ENTRYPOINT ["java","-Dspring.profiles.active=${PROFILE}", "-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
3 changes: 3 additions & 0 deletions DuDung-Infrastructure/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
bootJar { enabled = false }
jar { enabled = true }

dependencies {
implementation("com.slack.api:slack-api-client:1.27.2")
implementation 'io.github.openfeign:feign-httpclient:12.1'
Expand Down

0 comments on commit 7e5947e

Please sign in to comment.