Skip to content

Deploy Wep App

Deploy Wep App #37

name: Deploy to Azure Wep App
on:
workflow_dispatch
env:
AZURE_WEBAPP_NAME: webApp-DocumentVault-ne # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: './AZ204-DocumentVault/AZ204-DocumentVault' # set this to the path to your web app project, defaults to the repository root
DOTNET_VERSION: '7.0.x' # set this to the dot net version to use
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
# D:\Projekty\AZ204-DocumentVault\AZ204-DocumentVault\AZ204-DocumentVault\appsettings.json
- name: Replace env vars in file
uses: falnyr/[email protected]
env:
TenantId: ${{ secrets.TENANTID }}
ClientId: ${{ secrets.CLIENTID }}
with:
filename: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/appsettings.json
# Run dotnet build and publish
- name: Publish
run: dotnet publish ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} -c Release -o '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/myapp'
# Deploy to Azure Web apps
- name: 'Run Azure webapp deploy action using publish profile credentials'
uses: azure/[email protected]
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }} # Replace with your app name
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} # Define secret variable in repository settings as per action documentation
package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/myapp'