-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.38 KB
/
store-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
name: store-batch
on:
schedule:
- cron: '0 20 1 */6 *' # 6개월마다 1일 21시 (1/1, 7/1)
jobs:
store-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/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=lottoStoreJob
ls ~/store-deploy/batch/build/libs -all
java -Dspring.profiles.active=prod -jar ~/store-deploy/batch/build/libs/batch-0.0.1-SNAPSHOT.jar --job.name=lottoStoreJob
rm -rf ~/store-deploy