|  | 
|  | 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 - azurerediscache | 
|  | 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@v1 | 
|  | 21 | + with: | 
|  | 22 | + dotnet-version: '6.0.x' | 
|  | 23 | + include-prerelease: true | 
|  | 24 | + | 
|  | 25 | + - name: Build with dotnet | 
|  | 26 | + run: dotnet build --configuration Release | 
|  | 27 | + | 
|  | 28 | + - name: dotnet publish | 
|  | 29 | + run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp | 
|  | 30 | + | 
|  | 31 | + - name: Upload artifact for deployment job | 
|  | 32 | + uses: actions/upload-artifact@v3 | 
|  | 33 | + with: | 
|  | 34 | + name: .net-app | 
|  | 35 | + path: ${{env.DOTNET_ROOT}}/myapp | 
|  | 36 | + | 
|  | 37 | + deploy: | 
|  | 38 | + runs-on: windows-latest | 
|  | 39 | + needs: build | 
|  | 40 | + environment: | 
|  | 41 | + name: 'Production' | 
|  | 42 | + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | 
|  | 43 | + | 
|  | 44 | + steps: | 
|  | 45 | + - name: Download artifact from build job | 
|  | 46 | + uses: actions/download-artifact@v3 | 
|  | 47 | + with: | 
|  | 48 | + name: .net-app | 
|  | 49 | + | 
|  | 50 | + - name: Deploy to Azure Web App | 
|  | 51 | + id: deploy-to-webapp | 
|  | 52 | + uses: azure/webapps-deploy@v2 | 
|  | 53 | + with: | 
|  | 54 | + app-name: 'azurerediscache' | 
|  | 55 | + slot-name: 'Production' | 
|  | 56 | + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_5788D38657A242BEAF4851123508C95D }} | 
|  | 57 | + package: . | 
0 commit comments