-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.21 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
52 lines (42 loc) · 1.21 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
name: Deploy Docs
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'src/**'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Publish docs
run: dotnet publish docs/Parcel.NET.Docs/Parcel.NET.Docs.csproj -c Release -o output
- name: Rewrite base href
run: |
sed -i 's|<base href="/" />|<base href="/Parcel.NET/" />|g' output/wwwroot/index.html
if [ -f output/wwwroot/404.html ]; then
sed -i 's|<base href="/" />|<base href="/Parcel.NET/" />|g' output/wwwroot/404.html
fi
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: output/wwwroot
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5