diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml new file mode 100644 index 00000000..eedba901 --- /dev/null +++ b/.github/workflows/build-deploy.yml @@ -0,0 +1,67 @@ +name: Build and deploy + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' # Use appropriate .NET Core version for your app + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore --configuration Release + + - name: Publish + run: dotnet publish -c Release -o ./published + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: ASP-app + path: ./published + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + permissions: + id-token: write + contents: read + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: ASP-app + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_D3DC6FF382D244B5A8C333CC7A21ABC0 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_D0622B5C247D4AC6A67A950A3BDDECA4 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_9718D3FCE66043AD989F2A2AD544B813 }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'cpwebtest001' + slot-name: 'Production' + package: . diff --git a/.github/workflows/main_tierwebapp.yml b/.github/workflows/main_tierwebapp.yml new file mode 100644 index 00000000..972da940 --- /dev/null +++ b/.github/workflows/main_tierwebapp.yml @@ -0,0 +1,69 @@ +# 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 - tierwebapp + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + permissions: + contents: read #This is required for actions/checkout + + 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@v4 + 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 + contents: read #This is required for actions/checkout + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: ASP-app + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_D3DC6FF382D244B5A8C333CC7A21ABC0 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_D0622B5C247D4AC6A67A950A3BDDECA4 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_9718D3FCE66043AD989F2A2AD544B813 }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'tierwebapp' + slot-name: 'Production' + package: . + \ No newline at end of file diff --git a/aspnet-get-started/Views/Home/Index.cshtml b/aspnet-get-started/Views/Home/Index.cshtml index 32e1dd94..2aac5f99 100644 --- a/aspnet-get-started/Views/Home/Index.cshtml +++ b/aspnet-get-started/Views/Home/Index.cshtml @@ -3,9 +3,8 @@ }
ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.
- +Ravishankar Example .NET app to Azure App Service.
You can easily find a web hosting company that offers the right mix of features and price for your applications.