|
| 1 | +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy |
| 2 | +# More GitHub Actions for Azure: https://github.com/Azure/actions |
| 3 | + |
| 4 | +name: Build and deploy ASP.Net Core app to Azure Web App - wms-uz |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + runs-on: windows-latest |
| 15 | + |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Set up .NET Core |
| 20 | + uses: actions/setup-dotnet@v4 |
| 21 | + with: |
| 22 | + dotnet-version: '8.x' |
| 23 | + |
| 24 | + - name: Build with dotnet |
| 25 | + run: dotnet build --configuration Release |
| 26 | + working-directory: WMS.WebUI |
| 27 | + |
| 28 | + - name: dotnet publish |
| 29 | + run: dotnet publish -c Release -o ${{env.GITHUB_WORKSPACE}}\myapp |
| 30 | + working-directory: WMS.WebUI |
| 31 | + |
| 32 | + - name: Upload artifact for deployment job |
| 33 | + uses: actions/upload-artifact@v4 |
| 34 | + with: |
| 35 | + name: .net-app |
| 36 | + path: ${{env.GITHUB_WORKSPACE}}\myapp |
| 37 | + |
| 38 | + deploy: |
| 39 | + runs-on: windows-latest |
| 40 | + needs: build |
| 41 | + environment: |
| 42 | + name: 'Production' |
| 43 | + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} |
| 44 | + permissions: |
| 45 | + id-token: write #This is required for requesting the JWT |
| 46 | + |
| 47 | + steps: |
| 48 | + - name: Download artifact from build job |
| 49 | + uses: actions/download-artifact@v4 |
| 50 | + with: |
| 51 | + name: .net-app |
| 52 | + |
| 53 | + - name: Login to Azure |
| 54 | + uses: azure/login@v2 |
| 55 | + with: |
| 56 | + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_CF1C6DFFF15946BBA2FA2C10E382A358 }} |
| 57 | + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_3EB382EFBCE64A4BBE0B6DF56D5F4DB8 }} |
| 58 | + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_8842B7261F5343D491289BAA71366B39 }} |
| 59 | + |
| 60 | + - name: Deploy to Azure Web App |
| 61 | + id: deploy-to-webapp |
| 62 | + uses: azure/webapps-deploy@v3 |
| 63 | + with: |
| 64 | + app-name: 'wms-uz' |
| 65 | + slot-name: 'Production' |
| 66 | + package: . |
| 67 | + |
0 commit comments