-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.16 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Favorite18-BE-Build
on:
push:
branches: ["dev", "main"]
permissions:
contents: read
jobs:
build:
name: Favorite18-BE-CD
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Copy Jar File
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_KEY }}
timeout: 60s
source: "core/core-api/build/libs/favorite18-be-app.jar"
target: "/root/favorite-18/app/be"
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_KEY }}
timeout: 60s
script: |
cd /root/favorite-18/app/be
sh ./favorite-18-server-run.sh