Skip to content

CI job says successful but wwwroot remains empty #161

@slombardo

Description

@slombardo

I am using the following yml file:

name: Build and deploy ASP.NET app to Azure Web App

on:
  push:
    branches:
      - master
  workflow_dispatch:

jobs:
  build-and-deploy:
    runs-on: windows-latest

    steps:
      # Checkout the repository
      - uses: actions/checkout@v4

      # Install Visual Studio Build Tools with Web development components
      - name: 'Install Visual Studio Build Tools'
        run: |
          choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.WebBuildTools --includeRecommended --includeOptional" --ignore-checksums -y
        shell: powershell

      # Restore NuGet packages
      - name: 'Restore NuGet packages'
        run: |
          nuget restore "My.sln"
        shell: powershell

      # Build and publish the project
      - name: 'Build and publish the project'
        run: |
          $msbuild = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
          & $msbuild "MyProject/MyProject.csproj" `
            /p:Configuration=Release `
            /t:Package /p:PackageTempRootDir=..\publish
        shell: powershell

      # look for the publish output folder - works
      - name: 'List directories to find publish output'
        run: |
          Get-ChildItem -Path "publish/PackageTmp" -Directory
        shell: powershell

      # This works as expected
      - name: Upload Artifact 
        uses: actions/upload-artifact@v4.0.0
        with:
          name: published_webapp
          path: './publish/PackageTmp'

      # Deploy to Azure Web App using publish profile - says successful but wwwroot is empty
      - name: 'Deploy to Azure Web App'
        uses: azure/webapps-deploy@v3
        with:
          app-name: 'MySiteName'
          publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
          package: '.'
          # I've also tried:
          # package: './publish'
          # package: './[project dir]'

Yet no matter what I do I wwwroot remains empty. Logs all say it was successfully deployed with no errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions