-
Notifications
You must be signed in to change notification settings - Fork 71
91 lines (75 loc) · 2.75 KB
/
stride-docs-github.yml
File metadata and controls
91 lines (75 loc) · 2.75 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
# 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-latest
steps:
- name: .NET SDK Setup
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
# Checkout the Stride Docs repository from the branch that triggered the workflow
- name: Checkout Stride Docs
uses: actions/checkout@v6
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@v6
with:
repository: stride3d/stride
token: ${{ secrets.GITHUB_TOKEN }}
path: stride
lfs: true
ref: master
# Temporary solution till the new docfx is available
# - name: Checkout DocFX
# uses: actions/checkout@v6
# with:
# repository: dotnet/docfx
# # Tested commit
# ref: 917cda864650279e0bbe50b852cb98601e5efa4d
# path: docfx-build
# fetch-depth: 0
# - name: Restore npm dependencies
# run: npm install
# working-directory: docfx-build/templates
# - name: Build site templates
# run: npm run build
# working-directory: docfx-build/templates
# - name: Build DocFX from PR
# run: dotnet pack src/docfx -c Release /p:Version=2.9-stride -o drop/nuget
# working-directory: docfx-build
# shell: pwsh
# - name: Build Install DocFX
# run: dotnet tool install -g docfx --version 2.9-stride --add-source drop/nuget
# working-directory: docfx-build
# shell: pwsh
# End of Temporary solution
- 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.78.5
- name: Build documentation
run: ./build-all-skip-pdf.bat
working-directory: ${{ env.DOCS_PATH }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.DOCS_PATH }}/_site
publish_branch: gh-pages