I'm trying to deploy my app to AWS Amplify that's using Microsoft's template for .net7. Since I'm using Authenication/Authorization and local UserAccounts has a Blazor WebAssembly (Client), Blazor Server (.Net Core) and a shared project (contains Models) all under a single solution file. Most of the examples I've looked have the amplify.yml setup to deploy a client side Blazor app, I need to deploy the entire solution.
Here's my yml and my questions I'm running into
Q1 - In the examples, it has the build command "./dotnet7/dotnet publish -c Release -o release" that sends it into a top level release folder. But since there's a solution instead of a single project when the command runs there's a warning that its not support/recommend to do for a solution. So I'm building the solution and then setting the frontend to use the backend wwwroot folder. (I've also tried to have the section be backend and reference the backend server)
Q2 - I don't think I need to have two sections backend and frontend in the yml, lookin at How to correctly deploy Blazor WebAssembly (hosted) app? it looks like only the backend needs to be hosted/published.
Q3 - I'm using code first for EF. Where's the best place to apply the migrations, postBuild and run the command "./dotnet7/dotnet update-database" ? (I'm sure that once I get the app running I'd be good)
version: 1
frontend:
phases:
preBuild:
commands:
- curl -sSL https://dot.net/v1/dotnet-install.sh > dotnet-install.sh
- chmod +x *.sh
- ./dotnet-install.sh -c 7.0 -InstallDir ./dotnet7
- ./dotnet7/dotnet --version
build:
commands:
- ./dotnet7/dotnet publish -c Release
artifacts:
baseDirectory: /Server/bin/Release/net7.0/publish/wwwroot
files:
- '**/*'
cache:
paths: []