-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.67 KB
/
Copy pathpublish-github-pages.yml
File metadata and controls
64 lines (51 loc) · 1.67 KB
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
name: Deploy Blazor WASM to GitHub Pages
on:
push:
tags:
- 'v*'
workflow_dispatch:
env:
WASM_PROJECT: 'src/MakerPrompt.UI.Blazor/MakerPrompt.UI.Blazor.csproj'
OUTPUT_DIR: 'publish_wasm'
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment: github-pages
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Install MAUI workloads
run: dotnet workload install wasm-tools
- name: Publish Blazor App
run: dotnet publish ${{ env.WASM_PROJECT }} -c Release -o ${{ env.OUTPUT_DIR }}
- name: Add GitHub Pages artifacts
run: |
touch ${{ env.OUTPUT_DIR }}/wwwroot/.nojekyll
cp .github/workflows/gh-pages/404.html ${{ env.OUTPUT_DIR }}/wwwroot/404.html
cp .github/workflows/gh-pages/decode.js ${{ env.OUTPUT_DIR }}/wwwroot/decode.js
cp .github/workflows/gh-pages/index.html ${{ env.OUTPUT_DIR }}/wwwroot/index.html
- name: Rewrite Base Href
uses: SteveSandersonMS/ghaction-rewrite-base-href@v1
with:
html_path: ${{ env.OUTPUT_DIR }}/wwwroot/index.html
base_href: /MakerPrompt/
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.OUTPUT_DIR }}/wwwroot
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4