Skip to content

Commit fe7b77a

Browse files
committed
Add or update the Azure App Service build and deployment workflow config
1 parent 375bc41 commit fe7b77a

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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 app to Azure Web App - mydeployment1
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: windows-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Setup MSBuild path
20+
uses: microsoft/setup-msbuild@v1.0.2
21+
22+
- name: Setup NuGet
23+
uses: NuGet/setup-nuget@v1.0.5
24+
25+
- name: Restore NuGet packages
26+
run: nuget restore
27+
28+
- name: Publish to folder
29+
run: msbuild /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="\published\"
30+
31+
- name: Upload artifact for deployment job
32+
uses: actions/upload-artifact@v2
33+
with:
34+
name: ASP-app
35+
path: '/published/**'
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@v2
47+
with:
48+
name: ASP-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: 'mydeployment1'
55+
slot-name: 'Production'
56+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_F4053F80A4A545B49EE72B68000E45FD }}
57+
package: .

0 commit comments

Comments
 (0)