-
Notifications
You must be signed in to change notification settings - Fork 68
61 lines (50 loc) · 1.82 KB
/
stride-docs-github.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
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build Stride Docs for GitHub Staging
env:
COMMON_SETTINGS_PATH: en/docfx.json
VERSION: "2.0.0.${{ github.run_number }}"
DOCS_PATH: stride-docs
on:
workflow_dispatch:
jobs:
publish-docs:
runs-on: windows-2022
steps:
- name: .NET SDK Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
# Checkout the Stride Docs repository from the branch that triggered the workflow
- name: Checkout Stride Docs
uses: actions/checkout@v4
with:
path: ${{ env.DOCS_PATH }}
lfs: true
- name: Set Version in docfx.json
run: |
$settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw
$updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}"
Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent
shell: pwsh
# Checkout the Stride repository from the default branch
- name: Checkout Stride (note the LFS)
uses: actions/checkout@v4
with:
repository: stride3d/stride
token: ${{ secrets.GITHUB_TOKEN }}
path: stride
lfs: true
- name: Install DocFX
# This installs the latest version of DocFX and may introduce breaking changes
# run: dotnet tool update -g docfx
# This installs a specific, tested version of DocFX.
run: dotnet tool update -g docfx --version 2.77.0
- name: Build documentation
run: ./build-all.bat
working-directory: ${{ env.DOCS_PATH }}
- name: Deploy
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.DOCS_PATH }}/_site
publish_branch: gh-pages