Add workflows/docs-stable.yaml

This commit is contained in:
Andrey Akinshin 2022-09-26 19:35:43 +03:00
Родитель 37d0cf5d36
Коммит dbccef2dc2
2 изменённых файлов: 68 добавлений и 4 удалений

56
.github/workflows/docs-stable.yaml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,56 @@
name: docs-stable
on:
push:
branches:
- docs-stable
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: docs-stable
- name: Build BenchmarkDotNet
run: ./build.bat --target Build
- name: Download changelog
run: ./build.bat --target DocFX_Changelog_Download --LatestVersions true --StableVersions true
env:
GITHUB_PRODUCT: ChangelogBuilder
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build documentation
run: ./build.bat --target DocFX_Build
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: site
path: docs/_site
deploy:
concurrency: ci-${{ github.ref }}
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v1
with:
name: site
- name: Deploy documentation
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: site
GIT_CONFIG_NAME: Andrey Akinshin
GIT_CONFIG_EMAIL: andrey.akinshin@gmail.com
CLEAN: true

Просмотреть файл

@ -1,3 +1,4 @@
using System;
using System.IO;
using System.Linq;
using System.Text;
@ -428,12 +429,19 @@ public class DocFxChangelogDownloadTask : FrostingTask<BuildContext>
context.DocfxChangelogDownload(
DocumentationHelper.BdnAllVersions[i],
DocumentationHelper.BdnAllVersions[i - 1]);
} else if (context.Argument("LatestVersions", false))
{
for (int i = DocumentationHelper.BdnAllVersions.Length - 2; i < DocumentationHelper.BdnAllVersions.Length; i++)
context.DocfxChangelogDownload(
DocumentationHelper.BdnAllVersions[i],
DocumentationHelper.BdnAllVersions[i - 1]);
}
context.DocfxChangelogDownload(
DocumentationHelper.BdnNextVersion,
DocumentationHelper.BdnAllVersions.Last(),
"HEAD");
if (!context.Argument("StableVersions", false))
context.DocfxChangelogDownload(
DocumentationHelper.BdnNextVersion,
DocumentationHelper.BdnAllVersions.Last(),
"HEAD");
}
}