Skip to content

Commit f49ea61

Browse files
committed
feat: GitHub action for GitHub Pages updated
1 parent 37a1ee8 commit f49ea61

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/stride-docs-github.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
name: Build Stride Docs for GitHub Staging
44

5+
env:
6+
COMMON_SETTINGS_PATH: en/docfx.json
7+
VERSION: "2.0.0.${{ github.run_number }}"
8+
DOCS_PATH: stride-docs
9+
510
on:
611
workflow_dispatch:
712

@@ -10,8 +15,7 @@ jobs:
1015
runs-on: windows-2022
1116

1217
steps:
13-
# Setup .NET SDK
14-
- name: Dotnet Setup
18+
- name: .NET SDK Setup
1519
uses: actions/setup-dotnet@v4
1620
with:
1721
dotnet-version: 8.x
@@ -20,9 +24,16 @@ jobs:
2024
- name: Checkout Stride Docs
2125
uses: actions/checkout@v4
2226
with:
23-
path: stride-docs
27+
path: ${{ env.DOCS_PATH }}
2428
lfs: true
2529

30+
- name: Set Version in docfx.json
31+
run: |
32+
$settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw
33+
$updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}"
34+
Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent
35+
shell: pwsh
36+
2637
# Checkout the Stride repository from the default branch
2738
- name: Checkout Stride (note the LFS)
2839
uses: actions/checkout@v4
@@ -40,11 +51,11 @@ jobs:
4051

4152
- name: Build documentation
4253
run: ./build-all.bat
43-
working-directory: stride-docs
54+
working-directory: ${{ env.DOCS_PATH }}
4455

4556
- name: Deploy
4657
uses: peaceiris/[email protected]
4758
with:
4859
github_token: ${{ secrets.GITHUB_TOKEN }}
49-
publish_dir: stride-docs/_site
60+
publish_dir: ${{ env.DOCS_PATH }}/_site
5061
publish_branch: gh-pages

0 commit comments

Comments
 (0)