-
Notifications
You must be signed in to change notification settings - Fork 73
61 lines (47 loc) · 1.6 KB
/
builds-docs.yml
File metadata and controls
61 lines (47 loc) · 1.6 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
name: github pages
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
pages: write
jobs:
deploy:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install MAUI workload
run: dotnet workload install maui
- name: Install wasm-tools workload
run: dotnet workload install wasm-tools
- name: Restore .NET tools
run: dotnet tool restore
- name: Build the assemblies
run: dotnet build scripts/SkiaSharp.Extended-Pack.slnf -c Release -f net10.0
- name: Publish Blazor sample
run: dotnet publish samples/SkiaSharpDemo.Blazor/SkiaSharpDemo.Blazor.csproj -c Release -o publish/sample
- name: Build docs
run: dotnet docfx docs/docfx.json
- name: Copy Blazor sample into docs site
run: |
New-Item -ItemType Directory -Path docs/_site/sample -Force
Get-ChildItem -Path publish/sample/wwwroot -Force | Copy-Item -Destination docs/_site/sample -Recurse -Force
# Rewrite base href for GitHub Pages deployment
$indexPath = "docs/_site/sample/index.html"
(Get-Content $indexPath -Raw) -replace '<base href="/" />', '<base href="/SkiaSharp.Extended/sample/" />' | Set-Content $indexPath
shell: pwsh
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs/_site'
- name: Deploy
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3.6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_site