Skip to content

Build Stride Docs - Test Build #4

Build Stride Docs - Test Build

Build Stride Docs - Test Build #4

# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build Stride Docs - Test Build
env:
COMMON_SETTINGS_PATH: en/docfx.json
VERSION: "2.0.0.${{ github.run_number }}"
DOCS_PATH: stride-docs
on:
workflow_dispatch:
jobs:
build:
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
# - name: Display Updated docfx.json
# run: cat "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}"
# shell: pwsh
# - name: Fail the Workflow
# run: exit 1
# 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: 917cda8
path: docfx-build
- 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.3
- name: Build documentation
run: ./build-all.bat
working-directory: ${{ env.DOCS_PATH }}
- name: Compress artifact
run: 7z a -r DocFX-app.zip ./${{ env.DOCS_PATH }}/_site/*
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v5
with:
name: DocFX-app
path: DocFX-app.zip