mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 08:36:11 +02:00
feat: Add documentation build and deployment workflow
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: CI / Release / Docs
|
name: CI / Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -30,7 +30,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
src_changed: ${{ steps.check.outputs.src_changed }}
|
src_changed: ${{ steps.check.outputs.src_changed }}
|
||||||
docs_changed: ${{ steps.check.outputs.docs_changed }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -44,14 +43,10 @@ jobs:
|
|||||||
if [ "$BEFORE" = "0000000000000000000000000000000000000000" ]; then
|
if [ "$BEFORE" = "0000000000000000000000000000000000000000" ]; then
|
||||||
# Initial push — treat everything as changed
|
# Initial push — treat everything as changed
|
||||||
echo "src_changed=true" >> "$GITHUB_OUTPUT"
|
echo "src_changed=true" >> "$GITHUB_OUTPUT"
|
||||||
echo "docs_changed=true" >> "$GITHUB_OUTPUT"
|
|
||||||
else
|
else
|
||||||
SRC_CHANGED=$(git diff --name-only "$BEFORE" HEAD -- 'src/' | wc -l)
|
SRC_CHANGED=$(git diff --name-only "$BEFORE" HEAD -- 'src/' | wc -l)
|
||||||
DOCS_CHANGED=$(git diff --name-only "$BEFORE" HEAD -- 'docs/' | wc -l)
|
|
||||||
|
|
||||||
[ "$SRC_CHANGED" -gt 0 ] && echo "src_changed=true" >> "$GITHUB_OUTPUT" || echo "src_changed=false" >> "$GITHUB_OUTPUT"
|
[ "$SRC_CHANGED" -gt 0 ] && echo "src_changed=true" >> "$GITHUB_OUTPUT" || echo "src_changed=false" >> "$GITHUB_OUTPUT"
|
||||||
# Docs rebuild on docs/ OR src/ changes (docfx reads XML comments from assemblies)
|
|
||||||
[ "$DOCS_CHANGED" -gt 0 ] || [ "$SRC_CHANGED" -gt 0 ] && echo "docs_changed=true" >> "$GITHUB_OUTPUT" || echo "docs_changed=false" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@@ -177,39 +172,3 @@ jobs:
|
|||||||
# EchoHub-Client-osx-arm64.zip
|
# EchoHub-Client-osx-arm64.zip
|
||||||
# env:
|
# env:
|
||||||
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
docs:
|
|
||||||
name: Build & Deploy Docs
|
|
||||||
needs: [lint-markdown, detect-changes]
|
|
||||||
if: needs.detect-changes.outputs.docs_changed == 'true'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup .NET 10
|
|
||||||
uses: actions/setup-dotnet@v4
|
|
||||||
with:
|
|
||||||
dotnet-version: '10.0.x'
|
|
||||||
|
|
||||||
- name: Cache NuGet packages
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ~/.nuget/packages
|
|
||||||
key: nuget-${{ runner.os }}-${{ hashFiles('src/**/*.csproj') }}
|
|
||||||
restore-keys: nuget-${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Restore .NET tools
|
|
||||||
run: dotnet tool restore
|
|
||||||
|
|
||||||
- name: Build solution
|
|
||||||
run: dotnet build src/EchoHub.slnx --configuration Release
|
|
||||||
|
|
||||||
- name: Generate documentation
|
|
||||||
run: dotnet docfx docs/docfx.json
|
|
||||||
|
|
||||||
- name: Deploy to web branch
|
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: ./docs/_site
|
|
||||||
publish_branch: web
|
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
name: Docs
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
paths:
|
||||||
|
- 'docs/**'
|
||||||
|
- 'src/**'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-deploy:
|
||||||
|
name: Build & Deploy Docs
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup .NET 10
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: '10.0.x'
|
||||||
|
|
||||||
|
- name: Cache NuGet packages
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.nuget/packages
|
||||||
|
key: nuget-${{ runner.os }}-${{ hashFiles('src/**/*.csproj') }}
|
||||||
|
restore-keys: nuget-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Restore .NET tools
|
||||||
|
run: dotnet tool restore
|
||||||
|
|
||||||
|
- name: Build solution
|
||||||
|
run: dotnet build src/EchoHub.slnx --configuration Release
|
||||||
|
|
||||||
|
- name: Generate documentation
|
||||||
|
run: dotnet docfx docs/docfx.json
|
||||||
|
|
||||||
|
- name: Deploy to web branch
|
||||||
|
uses: peaceiris/actions-gh-pages@v4
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_dir: ./docs/_site
|
||||||
|
publish_branch: web
|
||||||
+21
-10
@@ -3,18 +3,29 @@
|
|||||||
{
|
{
|
||||||
"src": [
|
"src": [
|
||||||
{
|
{
|
||||||
"src": "../src",
|
"src": "../src/EchoHub.Core/bin/Release/net10.0",
|
||||||
"files": [
|
"files": ["EchoHub.Core.dll"]
|
||||||
"EchoHub.Core/EchoHub.Core.csproj",
|
|
||||||
"EchoHub.Server/EchoHub.Server.csproj",
|
|
||||||
"EchoHub.Client/EchoHub.Client.csproj"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dest": "api",
|
"dest": "api/core"
|
||||||
"properties": {
|
},
|
||||||
"TargetFramework": "net10.0"
|
{
|
||||||
}
|
"src": [
|
||||||
|
{
|
||||||
|
"src": "../src/EchoHub.Server/bin/Release/net10.0",
|
||||||
|
"files": ["EchoHub.Server.dll"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dest": "api/server"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": [
|
||||||
|
{
|
||||||
|
"src": "../src/EchoHub.Client/bin/Release/net10.0",
|
||||||
|
"files": ["EchoHub.Client.dll"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dest": "api/client"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"build": {
|
"build": {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>0.1.0</Version>
|
<Version>0.1.0</Version>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user