Skip to content

Commit

Permalink
cicd : edit workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JiwonKKang committed Jul 24, 2024
1 parent aeebff0 commit a973b5b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Build And Deploy with Docker
on:
push:
paths-ignore:
- '.github/workflows/**'
- 'README.md'
branches: [ develop ]

Expand All @@ -19,13 +18,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2 # git 레파지토리를 클론하는것과 같음

- name: Gradle에 실행 권한 부여
run: chmod +x gradlew

- name: gradle 빌드
run: ./gradlew build -x test
uses: actions/checkout@v4 # git 레파지토리를 클론하는것과 같음
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup docker buildx
id: buildx
Expand All @@ -45,11 +42,19 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

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

- name: Verify JAR File
run: ls -l application/app-api/build/libs/

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
file: ./application/app-api/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
Expand Down
3 changes: 2 additions & 1 deletion application/app-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM eclipse-temurin:17-jdk-alpine

# 빌드 컨텍스트의 경로를 맞추어 COPY 명령을 사용
COPY application/app-api/build/libs/app-api-0.0.1.jar mealtoktok.jar
RUN ls -l ./application/app-api/build/libs
COPY ./application/app-api/build/libs/app-api-0.0.1.jar mealtoktok.jar

ENTRYPOINT ["java", "-jar", "mealtoktok.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

public class HttpUtils {


public static HttpHeaders setHeaders(JwtTokens jwtTokens) {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add(SecurityProperties.ACCESS_TOKEN_HEADER, jwtTokens.accessToken());
Expand Down

0 comments on commit a973b5b

Please sign in to comment.