Skip to content

Commit 995ba93

Browse files
committed
new yml
1 parent 9bfe487 commit 995ba93

1 file changed

Lines changed: 8 additions & 16 deletions

File tree

.github/workflows/main_basicwebappusinggithub.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
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-
41
name: Build and deploy ASP.Net Core app to Azure Web App - basicwebappusinggithub
52

63
on:
@@ -13,29 +10,25 @@ jobs:
1310
build:
1411
runs-on: self-hosted
1512
permissions:
16-
contents: read #This is required for actions/checkout
13+
contents: read # This is required for actions/checkout
1714

1815
steps:
1916
- uses: actions/checkout@v4
2017

21-
- name: Set up .NET Core
22-
uses: actions/setup-dotnet@v4
23-
with:
24-
dotnet-version: '8.x'
25-
install-dir: ${{ runner.temp }}/dotnet
18+
- name: Display .NET version
19+
run: dotnet --version # Check if .NET SDK is installed
2620

2721
- name: Build with dotnet
2822
run: dotnet build --configuration Release
2923

3024
- name: dotnet publish
31-
run: ${{ runner.temp }}/dotnet/dotnet publish -c Release -o "${{ runner.temp }}/myapp"
32-
25+
run: dotnet publish -c Release -o "./myapp"
3326

3427
- name: Upload artifact for deployment job
3528
uses: actions/upload-artifact@v4
3629
with:
3730
name: .net-app
38-
path: ${{env.DOTNET_ROOT}}/myapp
31+
path: ./myapp
3932

4033
deploy:
4134
runs-on: self-hosted
@@ -44,8 +37,8 @@ jobs:
4437
name: 'Production'
4538
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
4639
permissions:
47-
id-token: write #This is required for requesting the JWT
48-
contents: read #This is required for actions/checkout
40+
id-token: write # This is required for requesting the JWT
41+
contents: read # This is required for actions/checkout
4942

5043
steps:
5144
- name: Download artifact from build job
@@ -66,5 +59,4 @@ jobs:
6659
with:
6760
app-name: 'basicwebappusinggithub'
6861
slot-name: 'Production'
69-
package: .
70-
62+
package: ./myapp

0 commit comments

Comments
 (0)