File tree Expand file tree Collapse file tree 1 file changed +19
-16
lines changed
Expand file tree Collapse file tree 1 file changed +19
-16
lines changed Original file line number Diff line number Diff line change 1- name : Build and deploy ASP.Net Core app to Azure Web App - musicostore
1+ name : Build and deploy .NET Core app to Azure Web App - musicostore
22
33on :
44 push :
99jobs :
1010 build :
1111 runs-on : ubuntu-latest
12- permissions :
13- contents : read
14-
1512 steps :
1613 - uses : actions/checkout@v4
1714
18- - name : Set up .NET
15+ - name : Set up .NET Core
1916 uses : actions/setup-dotnet@v4
2017 with :
21- dotnet-version : ' 10.0.x'
18+ dotnet-version : ' 8.0.x' # Ensure this matches your project (e.g., 6.0, 7.0, or 8.0)
19+
20+ - name : Restore dependencies
21+ run : dotnet restore
2222
23- - name : Build solution
24- run : dotnet build MusicoStore.sln -c Release
23+ - name : Build
24+ run : dotnet build --configuration Release --no-restore
2525
26- - name : Publish WebMVC
27- run : dotnet publish src/MusicoStore.WebMVC/MusicoStore.WebMVC.csproj -c Release -o ${{env.DOTNET_ROOT}}/myapp
26+ - name : Publish
27+ run : dotnet publish src/MusicoStore.WebMVC/MusicoStore.WebMVC.csproj -c Release -o ./publish
2828
29- - name : Upload artifact
29+ - name : Upload artifact for deployment job
3030 uses : actions/upload-artifact@v4
3131 with :
32- name : app
33- path : ${{env.DOTNET_ROOT}}/myapp
32+ name : webapp
33+ path : ./publish
3434
3535 deploy :
3636 runs-on : ubuntu-latest
3737 needs : build
38+ environment :
39+ name : ' Production' # Force it to Production to avoid Slot 404 errors
3840 permissions :
3941 id-token : write
4042 contents : read
4143
4244 steps :
43- - name : Download artifact
45+ - name : Download artifact from build job
4446 uses : actions/download-artifact@v4
4547 with :
46- name : app
48+ name : webapp
49+ path : ./deploy-package
4750
4851 - name : Login to Azure
4952 uses : azure/login@v2
5659 uses : azure/webapps-deploy@v3
5760 with :
5861 app-name : ' musicostore'
59- package : .
62+ package : ./deploy-package
You can’t perform that action at this time.
0 commit comments