-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (82 loc) · 2.37 KB
/
build-deploy-docs.yml
File metadata and controls
98 lines (82 loc) · 2.37 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Build and Deploy DocFX
on:
push:
branches: [ master ]
paths:
- 'docs/**'
- 'src/**'
- 'README.md'
- '.github/workflows/build-deploy-docs.yml'
pull_request:
branches: [ master ]
paths:
- 'docs/**'
- 'src/**'
- 'README.md'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
name: Build DocFX site
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET SDK (9.x)
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore solution (fetch Uno.Sdk and packages)
run: |
dotnet --info
dotnet restore ./src/DevTKSS.Uno.Samples.sln
- name: Install DocFX as .NET tool
run: |
dotnet tool install -g docfx --version 2.78.3
docfx --version
- name: Build metadata
working-directory: docs
run: |
docfx metadata docfx.json --logLevel Verbose
- name: Build site
working-directory: docs
run: |
docfx build docfx.json --logLevel Verbose
- name: Prepare publish folder (gh-pages/docs)
run: |
New-Item -ItemType Directory -Force -Path public/docs | Out-Null
robocopy "docs/_site" "public/docs" /E /NFL /NDL /NJH /NJS /NC /NS | Out-Null
if (Test-Path "docs/.nojekyll") { Copy-Item -Force "docs/.nojekyll" "public/docs/.nojekyll" }
shell: pwsh
- name: Upload site artifact
uses: actions/upload-artifact@v4
with:
name: docfx-site
path: public/docs
deploy:
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
name: Deploy to GitHub Pages (gh-pages/docs)
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download site artifact
uses: actions/download-artifact@v4
with:
name: docfx-site
path: public/docs
- name: Publish to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: public
keep_files: false
force_orphan: true