From 24c140ec4477be583b5978e5c641cd09b5756016 Mon Sep 17 00:00:00 2001 From: pavely12 Date: Mon, 17 Mar 2025 11:14:40 +0200 Subject: [PATCH 1/5] Create main.yml --- .github/workflows/main.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..1c65f32a1 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: Deploy ASP.NET Core app to Azure Web App + +on: + push: + branches: + - msdocs-app-service-sqldb-dotnetcore + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '6.0' + + - name: Build with dotnet + run: dotnet build --configuration Release + + - name: Publish with dotnet + run: dotnet publish --configuration Release --output ./publish + + - name: Deploy to Azure Web App + uses: azure/webapps-deploy@v2 + with: + app-name: cloud-apps01 + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: ./publish + + From 4076243f19b97008dbfa074c2b577b911e915b67 Mon Sep 17 00:00:00 2001 From: pavely12 Date: Mon, 17 Mar 2025 11:41:05 +0200 Subject: [PATCH 2/5] Update main --- .github/workflows/main.yml | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c65f32a1..ce5bbd292 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,34 +1,42 @@ -name: Deploy ASP.NET Core app to Azure Web App +name: Deploy to Azure Web App on: push: branches: - - msdocs-app-service-sqldb-dotnetcore + - main jobs: - build: + build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v2 + - name: Set up .NET + uses: actions/setup-dotnet@v3 with: - dotnet-version: '6.0' + dotnet-version: '7.0.x' # Use the version your app requires - - name: Build with dotnet - run: dotnet build --configuration Release + - name: Restore dependencies + run: dotnet restore - - name: Publish with dotnet - run: dotnet publish --configuration Release --output ./publish + - name: Build project + run: dotnet build --configuration Release --no-restore + - name: Publish project + run: dotnet publish -c Release -o ${{ github.workspace }}/publish + + - name: Login to Azure Web App + uses: azure/login@v2 + with: + client-id: ${{ 26379a30-523d-499b-ac56-582060bd8e56 }} + tenant-id: ${{ 81fcffd2-b4fc-4511-812b-a48b02631e81 }} + subscription-id: ${{ b7126c40-a209-4e7f-af20-a04162681c4c }} + - name: Deploy to Azure Web App + id: deploy-to-webapp uses: azure/webapps-deploy@v2 with: app-name: cloud-apps01 - publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} - package: ./publish - - + package: ${{ github.workspace }}/publish From a69bfb792f1ef26f231348bd6ad832d3b84ce6db Mon Sep 17 00:00:00 2001 From: pavely12 Date: Mon, 17 Mar 2025 11:50:12 +0200 Subject: [PATCH 3/5] dnetver --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce5bbd292..9383615f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: '7.0.x' # Use the version your app requires + dotnet-version: '8.x' # Use the version your app requires - name: Restore dependencies run: dotnet restore From 4039ab1ffad789f6481a7a8c7f9960f40cbc1ccb Mon Sep 17 00:00:00 2001 From: pavely12 Date: Mon, 17 Mar 2025 11:52:54 +0200 Subject: [PATCH 4/5] dnet1 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9383615f6..c3cd6bd86 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: '8.x' # Use the version your app requires + dotnet-version: '8.0.0' # Use the version your app requires - name: Restore dependencies run: dotnet restore From 60922ac1998d861516d52ab033fd3b3ca3edb944 Mon Sep 17 00:00:00 2001 From: pavely12 Date: Mon, 17 Mar 2025 11:58:45 +0200 Subject: [PATCH 5/5] dnet2 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c3cd6bd86..e77f9e757 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: '8.0.0' # Use the version your app requires + dotnet-version: '8' # Use the version your app requires - name: Restore dependencies run: dotnet restore