From 7abdee14786ea6a36a93541415ee55482f33d667 Mon Sep 17 00:00:00 2001 From: danhyunjo <105356854+danhyunjo@users.noreply.github.com> Date: Mon, 10 Apr 2023 16:14:24 +0900 Subject: [PATCH 1/4] Create blank.yml --- .github/workflows/blank.yml | 76 +++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/blank.yml diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml new file mode 100644 index 0000000..b3a322e --- /dev/null +++ b/.github/workflows/blank.yml @@ -0,0 +1,76 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Deployment + +on: + workflow_dispatch: + push: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Build with Gradle + uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 + with: + arguments: build + - uses: actions/upload-artifact@v3 + with: + name: jar + path: build/libs + + send-jar: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download jar + uses: actions/download-artifact@v3 + with: + name: jar + - name: Send jar to remote server + uses: appleboy/scp-action@master + with: + host: 34.64.59.236 + username: jdh6233114 + source: "real_coding_server-0.0.1-SNAPSHOT.jar" + target: "/home/adulkid.kaya" + key: ${{ secrets.PRIVATE_KEY }} + + run-app: + needs: send-jar + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Move deploy.sh + uses: appleboy/scp-action@master + with: + host: 34.64.59.236 + username: jdh6233114 + source: "deploy.sh" + target: "/home/{나의 userName}" + key: ${{ secrets.PRIVATE_KEY }} + - name: Execute script + uses: appleboy/ssh-action@master + with: + username: jdh6233114 + host: 34.64.59.236 + key: ${{ secrets.PRIVATE_KEY }} + script_stop: true + script: cd /home/{나의 userName} && chmod +x deploy.sh && ./deploy.sh From 57c04371ced3168f53e4fa93b0f4cad4f601dd11 Mon Sep 17 00:00:00 2001 From: danhyunjo <105356854+danhyunjo@users.noreply.github.com> Date: Mon, 10 Apr 2023 16:27:16 +0900 Subject: [PATCH 2/4] Update blank.yml --- .github/workflows/blank.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index b3a322e..7cd6066 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -49,7 +49,7 @@ jobs: host: 34.64.59.236 username: jdh6233114 source: "real_coding_server-0.0.1-SNAPSHOT.jar" - target: "/home/adulkid.kaya" + target: "/home/jdh6233114" key: ${{ secrets.PRIVATE_KEY }} run-app: From c5138062d0a8296d0c8fefe5cf2f6de3fb8790a4 Mon Sep 17 00:00:00 2001 From: danhyunjo <105356854+danhyunjo@users.noreply.github.com> Date: Mon, 10 Apr 2023 16:31:08 +0900 Subject: [PATCH 3/4] Update blank.yml --- .github/workflows/blank.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index 7cd6066..610f84c 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -64,7 +64,7 @@ jobs: host: 34.64.59.236 username: jdh6233114 source: "deploy.sh" - target: "/home/{나의 userName}" + target: "/home/jdh6233114" key: ${{ secrets.PRIVATE_KEY }} - name: Execute script uses: appleboy/ssh-action@master @@ -73,4 +73,4 @@ jobs: host: 34.64.59.236 key: ${{ secrets.PRIVATE_KEY }} script_stop: true - script: cd /home/{나의 userName} && chmod +x deploy.sh && ./deploy.sh + script: cd /home/jdh6233114 && chmod +x deploy.sh && ./deploy.sh From 3e6d7e66f9cf3d81218944ac40cf495c4770547b Mon Sep 17 00:00:00 2001 From: danhyunjo <105356854+danhyunjo@users.noreply.github.com> Date: Mon, 10 Apr 2023 16:39:01 +0900 Subject: [PATCH 4/4] Delete deployment.yml --- .github/workflows/deployment.yml | 76 -------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 .github/workflows/deployment.yml diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml deleted file mode 100644 index 2be1220..0000000 --- a/.github/workflows/deployment.yml +++ /dev/null @@ -1,76 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle - -name: Deployment - -on: - workflow_dispatch: - push: - branches: [ "main" ] - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - - name: Build with Gradle - uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 - with: - arguments: build - - uses: actions/upload-artifact@v3 - with: - name: jar - path: build/libs - - send-jar: - needs: build - runs-on: ubuntu-latest - steps: - - name: Download jar - uses: actions/download-artifact@v3 - with: - name: jar - - name: Send jar to remote server - uses: appleboy/scp-action@master - with: - host: {나의 public ip} - username: {나의 userName} - source: "real_coding_server-0.0.1-SNAPSHOT.jar" - target: "/home/{나의 userName}" - key: ${{ secrets.PRIVATE_KEY }} - - run-app: - needs: send-jar - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Move deploy.sh - uses: appleboy/scp-action@master - with: - host: {나의 public ip} - username: {나의 userName} - source: "deploy.sh" - target: "/home/{나의 userName}" - key: ${{ secrets.PRIVATE_KEY }} - - name: Execute script - uses: appleboy/ssh-action@master - with: - username: {나의 userName} - host: {나의 public ip} - key: ${{ secrets.PRIVATE_KEY }} - script_stop: true - script: cd /home/{나의 userName} && chmod +x deploy.sh && ./deploy.sh