Add or update the Azure App Service build and deployment workflow config #1
This file contains 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
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | |
# More GitHub Actions for Azure: https://github.com/Azure/actions | |
name: Build and deploy ASP app to Azure Web App - go-up | |
on: | |
push: | |
branches: | |
- develop | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup MSBuild path | |
uses: microsoft/setup-msbuild@v1.0.2 | |
- name: Setup NuGet | |
uses: NuGet/setup-nuget@v1.0.5 | |
- name: Restore NuGet packages | |
run: nuget restore | |
- name: Publish to folder | |
run: msbuild /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="\published\" | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ASP-app | |
path: '/published/**' | |
deploy: | |
runs-on: windows-latest | |
needs: build | |
environment: | |
name: 'Production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
permissions: | |
id-token: write #This is required for requesting the JWT | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v3 | |
with: | |
name: ASP-app | |
- name: Login to Azure | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_4591CB156E7242CA8FA72D18BD83758E }} | |
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_E294D7336EF64217AF5253E12C8CC41A }} | |
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_A4E282A5E8B448E29CFA1BA235468183 }} | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: 'go-up' | |
slot-name: 'Production' | |
package: . | |