-
-
Notifications
You must be signed in to change notification settings - Fork 232
74 lines (57 loc) · 1.96 KB
/
sales.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
name: Sales Website CD
env:
APP_SERVICE_NAME: 'bitservices'
on:
workflow_dispatch:
push:
branches: [ "main" ]
permissions:
contents: read
jobs:
build_api_blazor:
name: build api + blazor web
runs-on: ubuntu-24.04
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: src/global.json
- name: Install wasm
run: cd src && dotnet workload install wasm-tools
- name: Generate CSS/JS files
run: dotnet build src/Websites/Sales/src/Bit.Websites.Sales.Client/Bit.Websites.Sales.Client.csproj -t:BeforeBuildTasks --no-restore -c Release
- name: Publish
run: dotnet publish src/Websites/Sales/src/Bit.Websites.Sales.Server/Bit.Websites.Sales.Server.csproj -c Release --self-contained -r linux-x64 -o server
- name: Upload server artifact
uses: actions/upload-artifact@v4
with:
name: server-bundle
path: server
include-hidden-files: true # Required for wwwroot/.well-known folder
deploy_api_blazor:
name: deploy api + blazor
needs: build_api_blazor
runs-on: ubuntu-24.04
environment:
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Retrieve server bundle
uses: actions/download-artifact@v4
with:
name: server-bundle
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.APP_SERVICE_NAME }}
slot-name: 'production'
publish-profile: ${{ secrets.BITSERVICES_AZURE_APP_SERVICE_PUBLISH_PROFILE }}
package: .
- name: Purge cache
uses: jakejarvis/[email protected]
env:
CLOUDFLARE_ZONE: ${{ secrets.BITSERVICES_COMPANY_CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}