From 77150b9984d9b41098b604514082d6d4215ba51e Mon Sep 17 00:00:00 2001 From: dungbik Date: Wed, 18 Feb 2026 16:13:55 +0900 Subject: [PATCH 1/2] Chore: Update CI/CD workflows --- .github/workflows/cd.yml | 30 +++++++++++++++++++++ .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++ Dockerfile | 23 +++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 .github/workflows/cd.yml create mode 100644 .github/workflows/ci.yml create mode 100644 Dockerfile diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..c314eb7 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,30 @@ +name: CD + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Login to DockerHub + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + + - name: Extract Docker image metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: dungbik/flipnote-reaction + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..66b6fa3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle + run: ./gradlew build -x test + + - name: Run tests + run: ./gradlew test + + dependency-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run dependency check + uses: dependency-check/Dependency-Check_Action@main + with: + project: 'FlipNote-Reaction' + path: '.' + format: 'HTML' + + - name: Upload dependency check report + uses: actions/upload-artifact@v4 + if: always() + with: + name: dependency-check-report + path: reports/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b5f80a5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM gradle:8-jdk21 AS build +WORKDIR /app + +COPY build.gradle.kts settings.gradle.kts ./ +COPY src ./src + +RUN gradle bootJar --no-daemon + +FROM eclipse-temurin:21-jre +WORKDIR /app + +ENV TZ=Asia/Seoul +RUN apt-get update \ + && apt-get install -y tzdata \ + && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \ + && echo $TZ > /etc/timezone \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=build /app/build/libs/reaction-0.0.1-SNAPSHOT.jar . + +EXPOSE 8083 + +ENTRYPOINT ["java", "-jar", "reaction-0.0.1-SNAPSHOT.jar"] From 6ff036075cc2f035a78b94b36119fd721f6db000 Mon Sep 17 00:00:00 2001 From: dungbik Date: Wed, 18 Feb 2026 16:25:21 +0900 Subject: [PATCH 2/2] Chore: Update CD workflows --- .github/workflows/cd.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c314eb7..600e9c5 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,12 +1,16 @@ name: CD on: - push: + workflow_run: + workflows: [ "CI" ] + types: + - completed branches: - main jobs: deploy: + if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: