From 093561de6ca3e18da6019db68c7d44272325634b Mon Sep 17 00:00:00 2001 From: kunsanglee Date: Fri, 26 Jul 2024 11:29:45 +0900 Subject: [PATCH 1/6] =?UTF-8?q?refactor:=20Github=20Actions=20Gradle,=20Do?= =?UTF-8?q?cker=20Build=20=EC=BA=90=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-pull-request.yml | 12 +++++++++++- .github/workflows/backend-push.yml | 17 ++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/backend-pull-request.yml b/.github/workflows/backend-pull-request.yml index 113972929..a75df2089 100644 --- a/.github/workflows/backend-pull-request.yml +++ b/.github/workflows/backend-pull-request.yml @@ -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..6f8b0387b 100644 --- a/.github/workflows/backend-push.yml +++ b/.github/workflows/backend-push.yml @@ -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 From dfd6d28b213f5f9fb680e28a8042cc3c2b59c206 Mon Sep 17 00:00:00 2001 From: kunsanglee Date: Fri, 26 Jul 2024 12:26:17 +0900 Subject: [PATCH 2/6] =?UTF-8?q?refactor:=20Docker=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=ED=8F=AC=ED=8A=B8=20=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-push.yml b/.github/workflows/backend-push.yml index 6f8b0387b..e3f6a9595 100644 --- a/.github/workflows/backend-push.yml +++ b/.github/workflows/backend-push.yml @@ -79,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 From 1c7481c27eb92e679fa55bb96b5cb580f3335e60 Mon Sep 17 00:00:00 2001 From: kunsanglee Date: Fri, 26 Jul 2024 12:46:53 +0900 Subject: [PATCH 3/6] =?UTF-8?q?refactor:=20Docker=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=ED=8F=AC=ED=8A=B8=20=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-pull-request.yml | 2 +- .github/workflows/backend-push.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend-pull-request.yml b/.github/workflows/backend-pull-request.yml index a75df2089..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/**' diff --git a/.github/workflows/backend-push.yml b/.github/workflows/backend-push.yml index e3f6a9595..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/**' From 54fe581018df65449a9acf830685715329a48243 Mon Sep 17 00:00:00 2001 From: kunsanglee Date: Fri, 26 Jul 2024 12:48:32 +0900 Subject: [PATCH 4/6] test --- server/src/main/java/server/haengdong/HaengdongApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } - + } From 678e2ded97cdc384997d5d579ea2288e2e14e587 Mon Sep 17 00:00:00 2001 From: kunsanglee Date: Fri, 26 Jul 2024 12:53:11 +0900 Subject: [PATCH 5/6] after cache --- server/src/main/java/server/haengdong/HaengdongApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/server/haengdong/HaengdongApplication.java b/server/src/main/java/server/haengdong/HaengdongApplication.java index 915acdcf5..31b6e46e7 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); } - + } From 068154ddba447440e42a4e32b4c67f96ef22bda1 Mon Sep 17 00:00:00 2001 From: kunsanglee Date: Fri, 26 Jul 2024 12:55:25 +0900 Subject: [PATCH 6/6] after cache2 --- server/src/main/java/server/haengdong/HaengdongApplication.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/main/java/server/haengdong/HaengdongApplication.java b/server/src/main/java/server/haengdong/HaengdongApplication.java index 31b6e46e7..7549a9784 100644 --- a/server/src/main/java/server/haengdong/HaengdongApplication.java +++ b/server/src/main/java/server/haengdong/HaengdongApplication.java @@ -8,6 +8,8 @@ public class HaengdongApplication { public static void main(String[] args) { SpringApplication.run(HaengdongApplication.class, args); + + } }