I am trying to deploy a webapp to azure through github actions, however the site/wwwroot folder is completely empty upon completion
- Nothing fails within the pipeline
- The artifact published has the correct files
- If I manually FTP the files to wwwroot then it works as expected
Any ideas would be appreciated
Snippet of .yaml below
name: Build and deploy
on:
push:
branches:
- main
workflow_dispatch:
env:
AZURE_WEBAPP_NAME: Name
AZURE_WEBAPP_PACKAGE_PATH: Namepublish
CONFIGURATION: Release
DOTNET_CORE_VERSION: 6.0.x
WORKING_DIRECTORY: Name
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
- name: Restore
run: dotnet restore "${{ env.WORKING_DIRECTORY }}"
- name: Build
run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Test
run: dotnet test "${{ env.WORKING_DIRECTORY }}" --no-build
- name: Publish
run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}"
- name: Publish Artifacts
uses: actions/upload-artifact@v3
with:
name: webapp
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
deploy:
runs-on: windows-latest
needs: build
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: webapp
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
- name: Deploy to Azure WebApp
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.Name_BBF6 }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
Also snippet of action log:
Package deployment using OneDeploy initiated.
{
id: '11111111111111',
status: 4,
status_text: '',
author_email: 'N/A',
author: 'N/A',
deployer: 'OneDeploy',
message: 'OneDeploy',
progress: '',
received_time: '2023-11-21T11:17:41.9110402Z',
start_time: '2023-11-21T11:17:42.1610338Z',
end_time: '2023-11-21T11:17:44.5828528Z',
last_success_end_time: '2023-11-21T11:17:44.5828528Z',
complete: true,
active: true,
is_temp: false,
is_readonly: true,
url: 'https://name.scm.azurewebsites.net/api/deployments/latest',
log_url: 'https://name.scm.azurewebsites.net/api/deployments/latest/log',
site_name: 'Name',
provisioningState: 'Succeeded'
}
Deploy logs can be viewed at https://name.scm.azurewebsites.net/api/deployments/1111111111/log
Successfully deployed web package to App Service.
2
Answers
The response from @Harshitha ended up taking me down the right path, changing to v2 with package . led me to this issue Problem with deploying Web API C# to Azure App Service when i use github actions
Fixing this, in turn fixed my issue strangely, I think App Insights added this config setting automatically as I never manually set it.
Changing WEBSITE_NODE_DEFAULT_VERSION = ~18 instead of 6.9.1 was the fix needed.
Thanks for your help.
The issue seems to be with your
yaml
file Upload and Deploy path.In Azure portal, whenever you enable
GitHub Actions settings
while create Azure Web App Serviceor
Configuring GitHub from Deployment Center,
yaml
file will be generated automatically.You can check the preview option as well.My
yaml
file:${{env.DOTNET_ROOT}}/myapp
.
Build Action:
My
wwwroot
directoryOutput: