Skip to content

Commit

Permalink
Add Azure Web App deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Andronovo-bit committed Mar 21, 2024
1 parent c15f5df commit 7c403a3
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
push:
branches: [ master, main ]

env:
AZURE_WEBAPP_NAME: 'WebApiCICDWorkFlow' # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: './publish_output' # set this to the path to your web app project, defaults to the repository root
AZURE_WEBAPP_SLOT_NAME: 'production' # (optional) If a slot should be used, set the slot name here


jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -26,12 +32,18 @@ jobs:
run: dotnet test ./WebApiCICDWorkFlow.Tests/WebApiCICDWorkFlow.Tests.csproj --configuration Release --verbosity normal

- name: Publish with dotnet
run: dotnet publish ./WebApiCICDWorkFlow.sln --configuration Release --no-build --output ./publish_output
run: dotnet publish ./WebApiCICDWorkFlow.sln --configuration Release --no-build --output ${{env.AZURE_WEBAPP_PACKAGE_PATH}}

- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: WebApiCICDWorkFlow_Production
path: ./publish_output

path: ${{env.AZURE_WEBAPP_PACKAGE_PATH}}

- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
slot-name: ${{ env.AZURE_WEBAPP_SLOT_NAME }}
publish-profile: ${{ secrets.AzureAppService_PublishProfile }}
package: ${{env.AZURE_WEBAPP_PACKAGE_PATH}}

0 comments on commit 7c403a3

Please sign in to comment.