Sales module demo CD #451
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sales module demo CD | |
| # Project templates come equipped with CI/CD for both Azure DevOps and GitHub, providing you with a hassle-free way to get started with your new project. It is important to note that you should not depend on the contents of this file. More info at https://bitplatform.dev/templates/dev-ops | |
| env: | |
| SERVER_ADDRESS: 'https://sales.bitplatform.dev' | |
| OpenAI__ApiKey: ${{ secrets.OpenAI__ApiKey }} | |
| OpenAI__Endpoint: ${{ secrets.OpenAI__Endpoint }} | |
| OPENAI__MODEL: ${{ secrets.OPENAI__MODEL }} | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build_api_blazor: | |
| name: build api + blazor web | |
| runs-on: windows-2025 | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: src/global.json | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Create project from Boilerplate | |
| run: | | |
| cd src/Templates/Boilerplate && dotnet build -c Release | |
| dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 | |
| dotnet new install Bit.Boilerplate.0.0.0.nupkg | |
| cd ../../../ && dotnet new bit-bp --name SalesModule --database PostgreSQL --module Sales --appInsights --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --ads | |
| - name: Update core appsettings.json | |
| uses: devops-actions/variable-substitution@v1.2 | |
| with: | |
| files: 'SalesModule/**/appsettings*json' | |
| env: | |
| WebAppRender.PrerenderEnabled: true | |
| ServerAddress: ${{ env.SERVER_ADDRESS }} | |
| WebAppRender.BlazorMode: 'BlazorWebAssembly' | |
| AdsPushVapid.PublicKey: ${{ secrets.SALES_PUBLIC_VAPIDKEY }} | |
| GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }} | |
| ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }} | |
| - name: Install wasm | |
| run: cd src && dotnet workload install wasm-tools | |
| - name: Configure bswup | |
| run: | | |
| sed -i "s/\/\/ self.mode = 'AlwaysPrerender'/self.mode = 'AlwaysPrerender'/g" SalesModule/src/Client/SalesModule.Client.Web/wwwroot/service-worker.published.js | |
| - name: Configure text embedding | |
| run: | | |
| sed -i 's/IsEmbeddingEnabled = false/IsEmbeddingEnabled = true/' SalesModule/src/Server/SalesModule.Server.Api/Infrastructure/Data/AppDbContext.cs | |
| - name: Generate CSS/JS files | |
| run: | | |
| dotnet build SalesModule/src/Client/SalesModule.Client.Core/SalesModule.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APP_VERSION}}" -p:InvariantGlobalization=true --no-restore -c Release | |
| dotnet build SalesModule/src/Client/SalesModule.Client.Web/SalesModule.Client.Web.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APP_VERSION}}" -p:InvariantGlobalization=true --no-restore -c Release | |
| - name: Publish | |
| run: dotnet publish SalesModule/src/Server/SalesModule.Server.Web/SalesModule.Server.Web.csproj -c Release -o server -p:Version="${{ vars.APP_VERSION}}" -p:InvariantGlobalization=true | |
| - name: Upload server artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: SalesModule | |
| path: server | |
| include-hidden-files: true # Required for wwwroot/.well-known folder | |
| build_blazor_hybrid_windows: | |
| name: build blazor hybrid (windows) | |
| runs-on: windows-2025 | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: src\global.json | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Create project from Boilerplate | |
| run: | | |
| cd src\Templates\Boilerplate && dotnet build -c Release | |
| dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 | |
| dotnet new install Bit.Boilerplate.0.0.0.nupkg | |
| cd ..\..\..\ && dotnet new bit-bp --name SalesModule --database PostgreSQL --module Sales --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --captcha reCaptcha --signalR --ads | |
| - name: Update core appsettings.json | |
| uses: devops-actions/variable-substitution@v1.2 | |
| with: | |
| files: 'SalesModule\**\appsettings*json' | |
| env: | |
| WebAppUrl: ${{ env.SERVER_ADDRESS }} | |
| ServerAddress: ${{ env.SERVER_ADDRESS }} | |
| Logging.Sentry.Dsn: ${{ secrets.ADMINPANEL_SENTRY_DSN }} | |
| GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }} | |
| WindowsUpdate.FilesUrl: https://windows-sales.bitplatform.dev | |
| - name: Use Bit.ResxTranslator | |
| run: | | |
| cd SalesModule | |
| dotnet tool install --global Bit.ResxTranslator --prerelease | |
| bit-resx-translate | |
| - name: Generate CSS/JS files | |
| run: dotnet build SalesModule\src\Client\SalesModule.Client.Core\SalesModule.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APP_VERSION}}" --no-restore -c Release | |
| - name: Publish | |
| run: | | |
| cd SalesModule\src\Client\SalesModule.Client.Windows\ | |
| dotnet publish SalesModule.Client.Windows.csproj -c Release -o .\publish-result -r win-x64 -p:Version="${{ vars.APP_VERSION}}" -p:PublishReadyToRun=true -p:PublishReadyToRunComposite=true --self-contained | |
| dotnet tool restore | |
| dotnet vpk pack -u SalesModule.Client.Windows -v "${{ vars.APP_VERSION }}" -p .\publish-result -e SalesModule.Client.Windows.exe -r win-x64 --framework webview2 --icon .\wwwroot\favicon.ico --packTitle 'SalesModule' | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: WinSalesModule | |
| path: SalesModule\src\Client\SalesModule.Client.Windows\Releases |