Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
202002536JHLee committed Jun 4, 2024
1 parent 4d628ce commit fe38071
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/deployment_scp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,39 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
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
- 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:
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.41.182
username: earlylee2
host: {나의 public ip}
username: {나의 userName}
source: "devlog_springboot-0.0.1-SNAPSHOT.jar"
target: "/home/earlylee2"
key: ${{ secrets.PRIVAE_KEY }}
target: "/home/{나의 userName}"
key: ${{ secrets.PRIVATE_KEY }}

run-app:
needs: send-jar
runs-on: ubuntu-latest
Expand All @@ -61,16 +61,16 @@ jobs:
- name: Move deploy.sh
uses: appleboy/scp-action@master
with:
host: 34.64.41.182
username: earlylee2
host: {나의 public ip}
username: {나의 userName}
source: "deploy.sh"
target: "/home/earlylee2"
key: ${{ secrets.PRIVAE_KEY }}
target: "/home/{나의 userName}"
key: ${{ secrets.PRIVATE_KEY }}
- name: Execute script
uses: appleboy/ssh-action@master
with:
username: earlylee2
host: 34.64.41.182
key: ${{ secrets.PRIVAE_KEY }}
username: {나의 userName}
host: {나의 public ip}
key: ${{ secrets.PRIVATE_KEY }}
script_stop: true
script: cd /home/earlylee2 && chmod +x deploy.sh && ./deploy.sh
script: cd /home/{나의 userName} && chmod +x deploy.sh && ./deploy.sh

0 comments on commit fe38071

Please sign in to comment.