Skip to content

Commit

Permalink
Merge pull request #32 from JeongHeumChoi/dev
Browse files Browse the repository at this point in the history
fix: CI 로직 최적화
  • Loading branch information
JeongHeumChoi authored Mar 18, 2024
2 parents d835f4f + 69483d8 commit 97a4989
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ jobs:
token: ${{ secrets.GIT_TOKEN }}
submodules: true

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

- name: Grant execute permission for gradlew
run: chmod +x gradlew

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

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
Expand Down
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
FROM gradle:8.5-jdk17 AS builder
COPY . /usr/src
WORKDIR /usr/src
RUN gradle wrapper --gradle-version 8.5
RUN ./gradlew clean build -x test

FROM openjdk:17-jdk-alpine
COPY --from=builder /usr/src/build/libs/startup_valley-0.0.1-SNAPSHOT.jar /usr/app/app.jar
ENTRYPOINT ["java", "-jar", "/usr/app/app.jar", "--spring.profiles.active=prod"]
FROM openjdk:17-alpine
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar", "--spring.profiles.active=prod"]

0 comments on commit 97a4989

Please sign in to comment.