Skip to content

Commit 6ea3ef6

Browse files
committed
Lower .Net version to 9. Manually build UI and API projects.
1 parent 56ffa2a commit 6ea3ef6

File tree

5 files changed

+40
-64
lines changed

5 files changed

+40
-64
lines changed

.github/workflows/deploy.yml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Azure Static Web Apps CI/CD
1+
name: Build & Deploy
22

33
on:
44
push:
@@ -8,37 +8,43 @@ on:
88
jobs:
99
build_and_deploy_job:
1010
runs-on: ubuntu-latest
11-
name: Build and Deploy Job
11+
name: Build and Deploy to Azure Static Web App
1212
permissions:
1313
id-token: write
1414
contents: read
1515
steps:
16+
# Checkout the repo
1617
- uses: actions/checkout@v3
1718
with:
1819
submodules: true
1920
lfs: false
20-
- name: Install OIDC Client from Core Package
21-
run: npm install @actions/core@1.6.0 @actions/http-client
22-
- name: Get Id Token
23-
uses: actions/github-script@v6
24-
id: idtoken
21+
# Install .Net and build the application
22+
- uses: actions/setup-dotnet@v5
2523
with:
26-
script: |
27-
const coredemo = require('@actions/core')
28-
return await coredemo.getIDToken()
29-
result-encoding: string
30-
- name: Build And Deploy
24+
dotnet-version: '9.0.x'
25+
- run: |
26+
cd api
27+
dotnet build -o dist
28+
# Install Node.js and build the application
29+
- uses: actions/setup-node@v3
30+
with:
31+
node-version: '22.x'
32+
- run: |
33+
cd ui
34+
npm ci
35+
npm run build
36+
# Deploy the application to Azure Static Web Apps
37+
- name: Deploy
3138
id: builddeploy
3239
uses: Azure/static-web-apps-deploy@v1
3340
with:
3441
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
3542
repo_token: ${{ secrets.GITHUB_TOKEN }}
3643
action: "upload"
37-
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
3844
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
39-
app_location: "./ui" # App source code path
40-
app_build_command: "npm ci && npm run build" # App build command
41-
output_location: "dist/home-library/browser" # Built app content directory - optional
42-
api_location: "./api" # Api source code path - optional
43-
api_build_command: "dotnet build" # Api build command - optional
44-
###### End of Repository/Build Configurations ######
45+
app_location: "./ui/dist/home-library/browser" # Location of the built application
46+
output_location: "" # Must be blank for pre-built apps
47+
api_location: "./api/dist" # Api source code path - optional
48+
# Skip build commands, we do it ourselves
49+
skip_app_build: true
50+
skip_api_build: true

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
##
44
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
55

6+
# Compiled output
7+
/ui/dist
8+
/api/*/dist
9+
/tmp
10+
/out-tsc
11+
/bazel-out
12+
613
# User-specific files
714
*.suo
815
*.user
@@ -288,4 +295,7 @@ __pycache__/
288295
*.odx.cs
289296
*.xsd.cs
290297

298+
# Angular
299+
.angular
300+
291301
appsettings.json
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<InvariantGlobalization>true</InvariantGlobalization>
88
<PublishAot>true</PublishAot>
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0" />
12+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
1313
</ItemGroup>
1414

1515
</Project>

ui/.gitignore

Lines changed: 0 additions & 43 deletions
This file was deleted.

ui/staticwebapp.config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"navigationFallback": {
33
"rewrite": "index.html",
44
"exclude": ["/*.{css,scss,js,png,jpg,gif,ico}"]
5+
},
6+
"platform": {
7+
"apiRuntime": "dotnet-isolated:9.0"
58
}
69
}

0 commit comments

Comments
 (0)