-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.76 KB
/
drwtStore-batch.yaml
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
50
51
52
53
54
name: drwtStore-batch
on:
workflow_dispatch:
inputs:
startDrwtNo:
description: 시작회차
default: ""
type: string
endDrwtNo:
description: 종료회차
default: ""
type: string
schedule:
- cron: '0 22 * * SUN' # 매주 일요일 22시
jobs:
drwtStore-batch:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v2
- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Gradle
run: ./gradlew clean --stacktrace --build-file=./batch/build.gradle.kts --exclude-task test build
- name: Upload JAR To Instance
uses: appleboy/scp-action@master
with:
host: ${{ secrets.REMOTE_SSH_HOST }}
username: ${{ secrets.REMOTE_SSH_USERNAME }}
key: ${{ secrets.REMOTE_SSH_KEY }}
source: "./batch/build/libs/batch-0.0.1-SNAPSHOT.jar"
target: "/home/opc/drwt-store-deploy"
- name: Execute Job with Remote SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_SSH_HOST }}
username: ${{ secrets.REMOTE_SSH_USERNAME }}
key: ${{ secrets.REMOTE_SSH_KEY }}
script: |
echo jobName=lottoDrwtStoreJob startDrwtNo=${{ inputs.startDrwtNo }} endDrwtNo=${{ inputs.endDrwtNo }}
ls ~/drwt-store-deploy/batch/build/libs -all
java -Dspring.profiles.active=prod -jar ~/drwt-store-deploy/batch/build/libs/batch-0.0.1-SNAPSHOT.jar --job.name=lottoDrwtStoreJob --startDrwtNo=${{ inputs.startDrwtNo }} --endDrwtNo=${{ inputs.endDrwtNo }}
rm -rf ~/drwt-store-deploy