Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike Chambers 635 posts 1252 karma points c-trib
    Aug 20, 2021 @ 22:03
    Mike Chambers
    1

    v9-r002 Continuous Deployment (GitRepo - Git Actions Workflow - Azure App service)

    Not sure if the below is a reasonable approach so would appreciate a sense check, or anybody willing to share their journey?

    git repo

    where the umbraco and wwwroot\umbraco and app_plugins\[package] folders from nuget packages aren't included in the repo. (as we expect our build/deploy script to restore immutable content files and assemblies)

    git actions

    dotnet clean
    dotnet restore
    dotnet build --configuration Release
    dotnet publish -o ./publish/
    azure/weapps-deploy the publish folder
    

    So even though

    dotnet publish implicitly restores and builds

    and

    dotnet build implicitly restores

    we need to duplicate those processes otherwise the umbracofolder doesn't make it into the publish folder

    it seems like I'm restoring 3 times and building twice? But I'm guessing the build step is what gets the umbraco folder available for publish... even though publish implicitly builds?

    Also, we have to implicitly add files and folders that I sort of expected to automatically publish?

    .csproj

     <ItemGroup>
        <Content Include="App_Plugins\**">
          <CopyToPublishDirectory>Always</CopyToPublishDirectory>
        </Content>
        <Content Include="Views\**\*.cshtml">
          <CopyToPublishDirectory>Always</CopyToPublishDirectory>
        </Content>
        <Content Include="appsettings.json" CopyToOutputDirectory="Always" />
        <Content Include="appsettings.Development.json" DependentUpon="appsettings.json" CopyToOutputDirectory="Always" />
        <Content Include="appsettings.Release.json" DependentUpon="appsettings.json" CopyToOutputDirectory="Always" />
        <Content Include="wwwroot\**">
            <CopyToPublishDirectory>Always</CopyToPublishDirectory>
        </Content>
    

    so that these required items also make it to the publish folder

    Next on the list is to also add

    <Content Include="uSync\**">
            <CopyToPublishDirectory>Always</CopyToPublishDirectory>
        </Content>
    

    I think also pre deployment we need a powershell script to empty the usync folder as deploying the published content won't delete items removed from the repo.

    ultimately hitting up the kuduApi

    Command-Kudu -command "powershell(rm -r -fo v9)" -dir "site\wwwroot\uSync"
    

    and potentially a post deploy powershell script to tidy anything up...

    So wondering if that's what others are finding? Or maybe a there's a better approach

Please Sign in or register to post replies

Write your reply to:

Draft