-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.8 KB
/
main.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
name: Build Blazor
on:
workflow_dispatch:
push:
branches: [ "main" ]
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Install WASM workload
run: |
dotnet workload install wasm-tools
dotnet workload install wasm-tools-net7
dotnet workload list
pwd && ls -la
echo "Workload paths:"
find /usr/share/dotnet/packs -name "Microsoft.NET.Runtime.WebAssembly.Sdk"
- name: Restore workloads
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore
- name: Build and Publish
run: |
pwd && ls -la
dotnet publish LaunchApp/LaunchApp.csproj -c Release -o ${{ runner.temp }}/published_app --no-restore
- name: Setup SPA routing
run: |
cp ${{ runner.temp }}/published_app/wwwroot/index.html ${{ runner.temp }}/published_app/wwwroot/404.html
sed -i 's/base href="\/"/base href="\/${{ github.event.repository.name }}\/"/' ${{ runner.temp }}/published_app/wwwroot/index.html
sed -i 's/autostart="false"/autostart="true"/' ${{ runner.temp }}/published_app/wwwroot/index.html
- name: Deploy to GitHub Pages
run: |
pwd && ls -la
git checkout --orphan gh-pages
git clean -fdx
git rm -rf .
cp -r ${{ runner.temp }}/published_app/wwwroot/. .
touch .nojekyll
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Deploy Blazor app to GitHub Pages"
git push -f origin gh-pages