forked from HyejiYu/PatTurning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request HyejiYu#33 from Imsyp/main
delete commits
- Loading branch information
Showing
1 changed file
with
47 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,60 +6,56 @@ on: | |
paths: | ||
- "server/**" | ||
branches: | ||
- main | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Set up Gradle | ||
uses: gradle/gradle-build-action@v3 | ||
with: | ||
gradle-version: '8.8' | ||
|
||
- name: Build with Gradle | ||
run: | | ||
cd server | ||
./gradlew build -x test | ||
- name: Deliver jar File | ||
if: success() | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.GCP_SERVER_VM_HOST }} | ||
username: ${{ secrets.GCP_SERVER_VM_USER }} | ||
key: ${{ secrets.GCP_SERVER_SSH_PRIVATE_KEY }} | ||
port: 22 | ||
source: server/build/libs/swdc-0.0.1-SNAPSHOT.jar | ||
target: /home/patturning1/deployment/ | ||
|
||
- name: Deploy to GCP VM | ||
if: success() | ||
uses: appleboy/[email protected] | ||
with: | ||
debug: true | ||
host: ${{ secrets.GCP_SERVER_VM_HOST }} | ||
username: ${{ secrets.GCP_SERVER_VM_USER }} | ||
key: ${{ secrets.GCP_SERVER_SSH_PRIVATE_KEY }} | ||
port: 22 | ||
script: | | ||
sudo docker stop swdc-container || true | ||
sudo docker rm swdc-container || true | ||
cd /home/patturning1/deployment | ||
sudo docker build -t swdc-app . | ||
sudo docker run -d -p 8080:8080 --name swdc-container -v /mnt:/mnt swdc-app | ||
|
||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Set up Gradle | ||
uses: gradle/gradle-build-action@v3 | ||
with: | ||
gradle-version: '8.8' | ||
|
||
- name: Build with Gradle | ||
run: | | ||
cd server | ||
./gradlew build -x test | ||
- name: Deliver jar File | ||
if: success() | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.GCP_SERVER_VM_HOST }} | ||
username: ${{ secrets.GCP_SERVER_VM_USER }} | ||
key: ${{ secrets.GCP_SERVER_SSH_PRIVATE_KEY }} | ||
port: 22 | ||
source: server/build/libs/swdc-0.0.1-SNAPSHOT.jar | ||
target: /home/patturning1/deployment/ | ||
|
||
- name: Deploy to GCP VM | ||
if: success() | ||
uses: appleboy/[email protected] | ||
with: | ||
debug: true | ||
host: ${{ secrets.GCP_SERVER_VM_HOST }} | ||
username: ${{ secrets.GCP_SERVER_VM_USER }} | ||
key: ${{ secrets.GCP_SERVER_SSH_PRIVATE_KEY }} | ||
port: 22 | ||
script: | | ||
sudo docker stop swdc-container || true | ||
sudo docker rm swdc-container || true | ||
cd /home/patturning1/deployment | ||
sudo docker build -t swdc-app . | ||
sudo docker run -d -p 8080:8080 --name swdc-container -v /mnt:/mnt swdc-app |