Skip to content

Commit d2f1dd9

Browse files
committed
fix: CI/CD workflow gradle 기반으로 수정
1 parent fd9219e commit d2f1dd9

2 files changed

Lines changed: 22 additions & 24 deletions

File tree

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
22
# More GitHub Actions for Azure: https://github.com/Azure/actions
3-
43
name: Build and deploy Java project to Azure Function App - optimo-user
54

65
on:
@@ -10,16 +9,16 @@ on:
109
workflow_dispatch:
1110

1211
env:
13-
AZURE_FUNCTIONAPP_NAME: optimo-user # set this to your function app name on Azure
14-
PACKAGE_DIRECTORY: '.' # set this to the directory which contains pom.xml file
15-
JAVA_VERSION: '17' # set this to the java version to use
12+
AZURE_FUNCTIONAPP_NAME: optimo-user # Azure Function 앱 이름
13+
PACKAGE_DIRECTORY: '.' # build.gradle이 있는 디렉토리
14+
JAVA_VERSION: '17' # Java 버전
1615

1716
jobs:
1817
build-and-deploy:
1918
runs-on: windows-latest
20-
permissions:
21-
id-token: write #This is required for requesting the JWT
22-
contents: read #This is required for actions/checkout
19+
permissions:
20+
id-token: write # JWT 요청용
21+
contents: read # checkout 권한
2322

2423
steps:
2524
- name: 'Checkout GitHub Action'
@@ -31,26 +30,25 @@ jobs:
3130
java-version: ${{ env.JAVA_VERSION }}
3231
distribution: 'microsoft'
3332

34-
- name: 'Restore Project Dependencies Using Mvn'
33+
- name: 'Build Project Using Gradle'
3534
shell: pwsh
3635
run: |
37-
pushd './${{ env.PACKAGE_DIRECTORY }}'
38-
mvn clean package
36+
pushd '${{ env.PACKAGE_DIRECTORY }}'
37+
./gradlew clean build
3938
popd
40-
41-
- name: Login to Azure
42-
uses: azure/login@v2
43-
with:
44-
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_F8AB61811A544B2DA83613DAC80C221E }}
45-
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_9ADCD142DBE34B8CB2C2F533E244BCA9 }}
46-
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_15F1B4FCE9C8498292F6A71F69D792DE }}
39+
40+
- name: Login to Azure
41+
uses: azure/login@v2
42+
with:
43+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_F8AB61811A544B2DA83613DAC80C221E }}
44+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_9ADCD142DBE34B8CB2C2F533E244BCA9 }}
45+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_15F1B4FCE9C8498292F6A71F69D792DE }}
4746

4847
- name: 'Run Azure Functions Action'
4948
uses: Azure/functions-action@v1
5049
id: fa
5150
with:
52-
app-name: 'optimo-user'
51+
app-name: '${{ env.AZURE_FUNCTIONAPP_NAME }}'
5352
slot-name: 'Production'
54-
package: '${{ env.PACKAGE_DIRECTORY }}'
55-
respect-pom-xml: true
56-
53+
package: '${{ env.PACKAGE_DIRECTORY }}/build/libs' # Gradle 빌드 결과 경로
54+
respect-pom-xml: false # pom.xml이 없으니 false로 변경

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ tasks.named('test') {
6464
}
6565

6666
azurefunctions {
67-
resourceGroup = 'student006-rg' // ⚠️ 여기에 실제 리소스 그룹명 입력
68-
appName = 'optimo-user' // ⚠️ Azure Function App 이름
69-
region = 'Korea Central' // ⚠️ 적절한 지역 선택
67+
resourceGroup = 'student006-rg'
68+
appName = 'optimo-user'
69+
region = 'Korea Central'
7070
runtime {
7171
os = 'linux'
7272
javaVersion = '17'

0 commit comments

Comments
 (0)