-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (33 loc) · 1.03 KB
/
be-cd-prod.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
name: BE CD for Prod
on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
- backend/**
jobs:
deploy:
timeout-minutes: 3
runs-on: [ self-hosted, linux, ARM64, prod ]
defaults:
run:
working-directory: ./backend
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setting prod-secret.yml
run: |
echo "${{ secrets.PROD_SECRET_YML }}" > ./src/main/resources/prod-secret.yml
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew bootJar
- name: Stop existing Java Application
run: ps -ef | grep 'ddangkong-0.0.1-SNAPSHOT.jar' | awk '{print $2}' | xargs sudo kill -15 || true
- name: Start Java Application
run: sudo nohup java -jar ddangkong-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod &