-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 1.76 KB
/
build.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: backend build jar file and upload artifact file
on:
workflow_call:
inputs:
profile:
description: 'profile'
required: true
type: string
artifact_name:
description: 'artifact name'
default: 'app-artifact'
required: false
type: string
jar_name:
description: 'jar name'
default: 'app.jar'
required: false
type: string
gradlew_options:
description: 'gradle options'
required: false
type: string
secrets:
secret_yml:
description: 'secret yml'
required: true
outputs:
artifact_name:
value: ${{ inputs.artifact_name }}
jar_name:
value: ${{ inputs.jar_name }}
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setting ${{ inputs.profile }}-secret.yml
run: |
echo "${{ secrets.secret_yml }}" > ./src/main/resources/${{ inputs.profile }}-secret.yml
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: BootJar with Gradle
run: ./gradlew bootJar ${{ inputs.gradlew_options }}
- name: Move artifact file # todo script 환경 분리
run: |
mkdir -p ${{ inputs.artifact_name }} && \
mv build/libs/*.jar ${{ inputs.artifact_name }}/${{ inputs.jar_name }} && \
mv scripts/* ${{ inputs.artifact_name }}/
- name: Upload artifact file
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: ./backend/${{ inputs.artifact_name }}