fix: workflows fix #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and deploy Java project to Azure Function App - optimo-user | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| env: | |
| AZURE_FUNCTIONAPP_NAME: optimo-user | |
| JAVA_VERSION: '17' | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Java ${{ env.JAVA_VERSION }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: 'temurin' | |
| - name: Grant execute permission | |
| run: chmod +x gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew clean build --stacktrace --info | |
| # 🔥 azureFunctionsPackage 대신 jar 작업 의존성 실행 | |
| - name: Prepare Azure Functions package | |
| run: ./gradlew jar azureFunctionsPackage --stacktrace | |
| - name: Login to Azure | |
| uses: azure/login@v2 | |
| with: | |
| client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_F8AB61811A544B2DA83613DAC80C221E }} | |
| tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_9ADCD142DBE34B8CB2C2F533E244BCA9 }} | |
| subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_15F1B4FCE9C8498292F6A71F69D792DE }} | |
| - name: Deploy to Azure Functions | |
| uses: Azure/functions-action@v1 | |
| with: | |
| app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} | |
| package: build/azure-functions/${{ env.AZURE_FUNCTIONAPP_NAME }} | |
| publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }} | |
| compress: true |