File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,21 @@ jobs:
3535 - name : Publish application
3636 run : dotnet publish PoFunQuiz.Server/PoFunQuiz.Server.csproj --configuration Release --output ./publish
3737
38+ - name : Optimize deployment size
39+ run : |
40+ # Remove unused Radzen CSS themes (keep only standard-base.css)
41+ find ./publish/wwwroot/_content/Radzen.Blazor/css -type f ! -name 'standard-base.css*' -delete
42+
43+ # Display optimization results
44+ echo "✅ Deployment optimized - removed unused Radzen themes and source maps"
45+
3846 - name : Create deployment package
3947 run : |
4048 cd publish
49+ ORIGINAL_SIZE=$(du -sh . | cut -f1)
4150 zip -r ../deploy.zip .
51+ ZIP_SIZE=$(du -sh ../deploy.zip | cut -f1)
52+ echo "📦 Deployment package created: $ZIP_SIZE (uncompressed: $ORIGINAL_SIZE)"
4253 cd ..
4354
4455 - name : Azure Login (Federated Credentials)
Original file line number Diff line number Diff line change 1+ <Project >
2+ <!-- Clean up unused files after publish to reduce deployment size -->
3+ <Target Name =" CleanupUnusedFiles" AfterTargets =" Publish" >
4+ <ItemGroup >
5+ <!-- Find all Radzen CSS files except standard-base.css -->
6+ <RadzenCssToDelete Include =" $(PublishDir)wwwroot\_content\Radzen.Blazor\css\**\*"
7+ Exclude =" $(PublishDir)wwwroot\_content\Radzen.Blazor\css\standard-base.css*" />
8+
9+ <!-- Find all source map files -->
10+ <SourceMapsToDelete Include =" $(PublishDir)wwwroot\_framework\**\*.map" />
11+ </ItemGroup >
12+
13+ <!-- Delete the files -->
14+ <Delete Files =" @(RadzenCssToDelete)" />
15+ <Delete Files =" @(SourceMapsToDelete)" />
16+
17+ <Message Text =" Deleted $(RadzenCssToDelete.Count()) unused Radzen theme files" Importance =" high" />
18+ <Message Text =" Deleted $(SourceMapsToDelete.Count()) source map files" Importance =" high" />
19+ </Target >
20+ </Project >
Original file line number Diff line number Diff line change 77 <DebugType >none</DebugType >
88 <DebugSymbols >false</DebugSymbols >
99 <InvariantGlobalization >true</InvariantGlobalization >
10+
11+ <!-- Optimization: Enable IL trimming to reduce deployment size -->
12+ <PublishTrimmed >true</PublishTrimmed >
13+ <TrimMode >link</TrimMode >
14+
15+ <!-- Optimization: Remove debug symbols and source maps from production builds -->
16+ <WasmStripILAfterAOT >true</WasmStripILAfterAOT >
17+
18+ <!-- Optimization: Enable compression -->
19+ <BlazorEnableCompression >true</BlazorEnableCompression >
20+
21+ <!-- Optimization: Don't copy symbols to output -->
22+ <CopyOutputSymbolsToPublishDirectory >false</CopyOutputSymbolsToPublishDirectory >
1023 </PropertyGroup >
1124
1225 <ItemGroup >
2033 <ProjectReference Include =" ..\PoFunQuiz.Core\PoFunQuiz.Core.csproj" />
2134 </ItemGroup >
2235
36+ <!-- Import custom build targets to exclude unused resources -->
37+ <Import Project =" ExcludeUnusedRadzenThemes.targets" />
2338
2439</Project >
You can’t perform that action at this time.
0 commit comments