fix: workflows fix #16
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 # Windows -> Linux로 변경 | |
| 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' # Microsoft -> Temurin으로 변경 | |
| - name: Grant execute permission | |
| run: chmod +x gradlew # Linux에서 권한 설정 | |
| - name: Build with Gradle | |
| run: ./gradlew clean build --stacktrace --info | |
| - name: Package Azure Functions | |
| run: ./gradlew 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 }} |