-
-
Notifications
You must be signed in to change notification settings - Fork 232
78 lines (60 loc) · 2.32 KB
/
platform.website.cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Platform Website CD
env:
WEB_APP_DEPLOYMENT_TYPE: 'SSR'
APP_SERVICE_NAME: 'bitplatform'
on:
workflow_dispatch:
push:
branches: [ "main" ]
permissions:
contents: read
jobs:
build_blazor_api_wasm:
name: build blazor api + web assembly
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
global-json-file: src/global.json
- name: Switch to blazor web assembly
run: sed -i 's/Microsoft.NET.Sdk.Web/Microsoft.NET.Sdk.BlazorWebAssembly/g' src/Websites/Platform/src/Bit.Websites.Platform.Web/Bit.Websites.Platform.Web.csproj
- name: Install wasm
run: dotnet workload install wasm-tools wasm-experimental --sdk-version=8.0.100-rc.1.23463.5
- name: Update appsettings.json api server address
uses: microsoft/variable-substitution@v1
with:
files: 'src/Websites/Platform/src/Bit.Websites.Platform.Web/appsettings.json'
env:
ApiServerAddress: 'api/'
- name: Generate CSS/JS files
run: dotnet build src/Websites/Platform/src/Bit.Websites.Platform.Web/Bit.Websites.Platform.Web.csproj -t:BeforeBuildTasks --no-restore
- name: Publish
run: dotnet publish src/Websites/Platform/src/Bit.Websites.Platform.Api/Bit.Websites.Platform.Api.csproj -p:BlazorMode=BlazorWebAssembly -p:WebAppDeploymentType="${{ env.WEB_APP_DEPLOYMENT_TYPE }}" -p:Configuration=Release --self-contained -r linux-x64 -o api-web
- name: Upload api-web artifact
uses: actions/upload-artifact@v3
with:
name: api-web-bundle
path: api-web
deploy_blazor_api_wasm:
name: deploy blazor api + web assembly
needs: build_blazor_api_wasm
runs-on: ubuntu-22.04
environment:
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Retrieve api-web bundle
uses: actions/download-artifact@v2
with:
name: api-web-bundle
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.APP_SERVICE_NAME }}
slot-name: 'production'
publish-profile: ${{ secrets.BITPLATFORM_AZURE_APP_SERVICE_PUBLISH_PROFILE }}
package: .