Skip to content

Commit dbccef2

Browse files
Add workflows/docs-stable.yaml
1 parent 37d0cf5 commit dbccef2

File tree

2 files changed

+68
-4
lines changed

2 files changed

+68
-4
lines changed

.github/workflows/docs-stable.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: docs-stable
2+
3+
on:
4+
push:
5+
branches:
6+
- docs-stable
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
steps:
13+
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
ref: docs-stable
18+
19+
- name: Build BenchmarkDotNet
20+
run: ./build.bat --target Build
21+
22+
- name: Download changelog
23+
run: ./build.bat --target DocFX_Changelog_Download --LatestVersions true --StableVersions true
24+
env:
25+
GITHUB_PRODUCT: ChangelogBuilder
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Build documentation
29+
run: ./build.bat --target DocFX_Build
30+
31+
- name: Upload Artifacts
32+
uses: actions/upload-artifact@v1
33+
with:
34+
name: site
35+
path: docs/_site
36+
37+
deploy:
38+
concurrency: ci-${{ github.ref }}
39+
needs: [build]
40+
runs-on: ubuntu-latest
41+
steps:
42+
43+
- name: Download Artifacts
44+
uses: actions/download-artifact@v1
45+
with:
46+
name: site
47+
48+
- name: Deploy documentation
49+
uses: JamesIves/[email protected]
50+
with:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
BRANCH: gh-pages
53+
FOLDER: site
54+
GIT_CONFIG_NAME: Andrey Akinshin
55+
GIT_CONFIG_EMAIL: [email protected]
56+
CLEAN: true

build/Program.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.IO;
23
using System.Linq;
34
using System.Text;
@@ -428,12 +429,19 @@ public override void Run(BuildContext context)
428429
context.DocfxChangelogDownload(
429430
DocumentationHelper.BdnAllVersions[i],
430431
DocumentationHelper.BdnAllVersions[i - 1]);
432+
} else if (context.Argument("LatestVersions", false))
433+
{
434+
for (int i = DocumentationHelper.BdnAllVersions.Length - 2; i < DocumentationHelper.BdnAllVersions.Length; i++)
435+
context.DocfxChangelogDownload(
436+
DocumentationHelper.BdnAllVersions[i],
437+
DocumentationHelper.BdnAllVersions[i - 1]);
431438
}
432439

433-
context.DocfxChangelogDownload(
434-
DocumentationHelper.BdnNextVersion,
435-
DocumentationHelper.BdnAllVersions.Last(),
436-
"HEAD");
440+
if (!context.Argument("StableVersions", false))
441+
context.DocfxChangelogDownload(
442+
DocumentationHelper.BdnNextVersion,
443+
DocumentationHelper.BdnAllVersions.Last(),
444+
"HEAD");
437445
}
438446
}
439447

0 commit comments

Comments
 (0)