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-
43name : Build and deploy Java project to Azure Function App - optimo-user
54
65on :
109 workflow_dispatch :
1110
1211env :
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
1716jobs :
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로 변경
0 commit comments