Skip to content

Commit

Permalink
add deployment info.
Browse files Browse the repository at this point in the history
  • Loading branch information
danwalmsley committed Oct 20, 2022
1 parent 11b925d commit 1d02dd6
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 35 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/azure-swa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Azure Static Web Apps CI/CD

on:
push:
branches:
- release/*

jobs:
build_and_deploy_job:
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup .NET Core SDK
uses: actions/[email protected]

- name: Install wasm-tools
run: dotnet workload install wasm-tools wasm-experimental

- name: Install DotNetCompress
run: dotnet tool install --global DotNetCompress --version 1.0.0-preview.4 --no-cache

- name: Publish .NET Project
run: dotnet publish Calc.Browser/Calc.Browser.csproj -c Release -o release --nologo

- name: Brotli Compress Output (dll)
run: DotNetCompress -d Calc.Browser/bin/Release/net7.0/browser-wasm/AppBundle/managed -p '*.dll'

- name: Brotli Compress Output (js)
run: DotNetCompress -d Calc.Browser/bin/Release/net7.0/browser-wasm/AppBundle/ -p '*.js'

- name: Brotli Compress Output (wasm)
run: DotNetCompress -d Calc.Browser/bin/Release/net7.0/browser-wasm/AppBundle/ -p '*.wasm'

- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APP_DEPLOY_KEY }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "Calc.Browser/bin/Release/net7.0/browser-wasm/AppBundle/" # App source code path
api_location: "" # Api source code path - optional
output_location: "" # Modify this to where your SSG places the built HTML - could be `dist`, `build`... check your config
skip_app_build: true
###### End of Repository/Build Configurations ######
10 changes: 10 additions & 0 deletions Calc.Browser/AppBundle/staticwebapp.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"routes": [
{
"route": "/*",
"headers": {
"Cache-Control": "public, must-revalidate, max-age=2419200"
}
}
]
}
2 changes: 1 addition & 1 deletion Calc.Browser/Calc.Browser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<TrimMode>full</TrimMode>
<WasmBuildNative>true</WasmBuildNative>
<InvariantGlobalization>true</InvariantGlobalization>
<WasmEnableSIMD>true</WasmEnableSIMD>
<EmccCompileOptimizationFlag>-O3</EmccCompileOptimizationFlag>
<EmccLinkOptimizationFlag>-O3</EmccLinkOptimizationFlag>
</PropertyGroup>
Expand All @@ -32,6 +31,7 @@
<WasmExtraFilesToDeploy Include="AppBundle\index.html" />
<WasmExtraFilesToDeploy Include="AppBundle\Logo.svg" />
<WasmExtraFilesToDeploy Include="AppBundle\main.js" />
<WasmExtraFilesToDeploy Include="AppBundle\staticwebapp.config.json" />
</ItemGroup>

<ItemGroup>
Expand Down
43 changes: 9 additions & 34 deletions Calc.Browser/Roots.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,17 @@

<!-- App -->

<assembly fullname="XamlPlayground" preserve="All" />
<assembly fullname="XamlPlayground.Wasm" preserve="All" />
<assembly fullname="Calc" preserve="All" />
<assembly fullname="Calc.Browser" preserve="All" />

<!-- Avalonia Themes -->

<assembly fullname="Avalonia.Themes.Fluent" preserve="All" />
<assembly fullname="Avalonia.Themes.Simple" preserve="All" />

<!-- Avalonia Core -->

<assembly fullname="Avalonia" preserve="All" />
<assembly fullname="Avalonia.Base" preserve="All" />
<assembly fullname="Avalonia.Controls" preserve="All" />
<assembly fullname="Avalonia.Dialogs" preserve="All" />
<assembly fullname="Avalonia.Markup" preserve="All" />
<assembly fullname="Avalonia.Markup.Xaml" preserve="All" />
<assembly fullname="Avalonia.Markup.Xaml.Loader" preserve="All" />
<assembly fullname="Avalonia.MicroCom" preserve="All" />

<!-- Avalonia Web -->

<assembly fullname="Avalonia.OpenGL" preserve="All" />
<assembly fullname="Avalonia.Skia" preserve="All" />
<assembly fullname="Avalonia.Web" preserve="All" />

<!-- Avalonia Behaviors -->

<assembly fullname="Avalonia.Xaml.Interactions" preserve="All" />
<assembly fullname="Avalonia.Xaml.Interactivity" preserve="All" />

<!-- AvaloniaEdit -->

<assembly fullname="AvaloniaEdit" preserve="All" />

<!-- AvaloniaEdit -->

<assembly fullname="Octokit" preserve="All" />
<assembly fullname="Material.Avalonia" preserve="All" />
<assembly fullname="Material.DataGrid" preserve="All" />
<assembly fullname="Material.Dialog" preserve="All" />
<assembly fullname="Material.Styles" preserve="All" />
<assembly fullname="Material.Colors" preserve="All" />
<assembly fullname="Material.Ripple" preserve="All" />
<assembly fullname="Material.Icons.Avalonia" preserve="All" />

</linker>

0 comments on commit 1d02dd6

Please sign in to comment.