diff --git a/.github/workflows/backend-pull-request.yml b/.github/workflows/backend-pull-request.yml index 113972929..ba6870a61 100644 --- a/.github/workflows/backend-pull-request.yml +++ b/.github/workflows/backend-pull-request.yml @@ -2,7 +2,7 @@ name: backend-pull-request on: pull_request: - branches: [ "main", "develop" ] + branches: [ "main", "develop", "feature/#121" ] paths: - 'server/**' @@ -18,6 +18,16 @@ jobs: - name: CheckOut uses: actions/checkout@v4 + - 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: Set up JDK 17 uses: actions/setup-java@v4 with: @@ -25,7 +35,7 @@ jobs: distribution: 'temurin' - name: Setup Gradle - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + uses: gradle/gradle-build-action@v2 - name: Test with Gradle Wrapper run: ./gradlew clean build diff --git a/.github/workflows/backend-push.yml b/.github/workflows/backend-push.yml index a35eaea7b..0a3b3e43f 100644 --- a/.github/workflows/backend-push.yml +++ b/.github/workflows/backend-push.yml @@ -2,7 +2,7 @@ name: backend-push on: push: - branches: [ "main", "develop" ] + branches: [ "main", "develop", "feature/#121" ] paths: - 'server/**' @@ -25,6 +25,16 @@ jobs: token: ${{secrets.CONFIG_SUBMODULE_TOKEN}} submodules: true + - 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: Set up JDK 17 uses: actions/setup-java@v4 with: @@ -32,7 +42,7 @@ jobs: distribution: 'temurin' - name: Setup Gradle - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + uses: gradle/gradle-build-action@v2 - name: Test with Gradle Wrapper run: ./gradlew test @@ -48,8 +58,9 @@ jobs: - name: Build and push run: | - docker buildx build --platform linux/arm64 -t \ - ${{ secrets.DOCKER_USERNAME }}/haengdong-backend-dev --push . + docker buildx build --platform linux/arm64 --cache-from=type=registry,ref=${{ secrets.DOCKER_USERNAME }}/haengdong-backend-dev:cache \ + --cache-to=type=registry,ref=${{ secrets.DOCKER_USERNAME }}/haengdong-backend-dev:cache,mode=max \ + -t ${{ secrets.DOCKER_USERNAME }}/haengdong-backend-dev --push . deploy: needs: build @@ -68,4 +79,4 @@ jobs: run: sudo docker pull ${{ secrets.DOCKER_USERNAME }}/haengdong-backend-dev - name: Docker run - run: sudo docker run -d -p 80:8080 --name haengdong-backend-dev haengdong/haengdong-backend-dev + run: sudo docker run -d -p 8080:8080 --name haengdong-backend-dev haengdong/haengdong-backend-dev diff --git a/server/src/main/java/server/haengdong/HaengdongApplication.java b/server/src/main/java/server/haengdong/HaengdongApplication.java index 31b6e46e7..915acdcf5 100644 --- a/server/src/main/java/server/haengdong/HaengdongApplication.java +++ b/server/src/main/java/server/haengdong/HaengdongApplication.java @@ -9,5 +9,5 @@ public class HaengdongApplication { public static void main(String[] args) { SpringApplication.run(HaengdongApplication.class, args); } - + }