mirror of
https://github.com/dotMorten/NmeaParser.git
synced 2026-02-07 08:14:20 +01:00
91 lines
2.8 KiB
YAML
91 lines
2.8 KiB
YAML
name: Publish Documentation
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- name: Clone NmeaParser
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Setup Visual Studio Command Prompt
|
|
uses: microsoft/setup-msbuild@v1.0.2
|
|
|
|
- name: Restore
|
|
run: |
|
|
msbuild /restore /t:Restore src/NmeaParser/NmeaParser.csproj /p:Configuration=Release
|
|
|
|
- name: Download DocFX
|
|
run: |
|
|
mkdir .tools/docfx
|
|
Invoke-WebRequest -Uri "https://github.com/dotnet/docfx/releases/download/v${env:DOCFXVERSION}/docfx.zip" -OutFile ".tools/docfx/docfx.zip"
|
|
[System.IO.Compression.ZipFile]::ExtractToDirectory(".tools/docfx/docfx.zip", ".tools/docfx" )
|
|
env:
|
|
DOCFXVERSION: 2.59.0
|
|
|
|
- name: Install .NET OMD Generator
|
|
run: dotnet tool install --tool-path .tools/omd dotMorten.OmdGenerator --version 1.4.0
|
|
|
|
- name: Generate OMD
|
|
run: |
|
|
mkdir artifacts/docs/api
|
|
.tools/omd/generateomd /source=src/NmeaParser /output=artifacts/docs/api/omd.html
|
|
|
|
- name: Install NuGet
|
|
uses: nuget/setup-nuget@v1
|
|
|
|
- name: Build Documentation
|
|
env:
|
|
DOCFX_SOURCE_BRANCH_NAME: main
|
|
run: |
|
|
nuget install memberpage -Version 2.59.0 -OutputDirectory docs
|
|
.tools/docfx/docfx.exe metadata docs/docfx.json
|
|
dotnet build docs/AppliesToGenerator\DocFXAppliesToGenerator.csproj
|
|
docs/AppliesToGenerator\bin\Debug\net6.0\DocFXAppliesToGenerator.exe docs/appliesToList.json
|
|
.tools/docfx/docfx.exe build docs/docfx.json
|
|
powershell -ExecutionPolicy ByPass -command "docs\FixApiRefLinks" -Path artifacts\docs_site\api\
|
|
|
|
- name: Upload static files as artifact
|
|
id: deployment
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: artifacts/docs_site
|
|
|
|
deploy:
|
|
needs: build
|
|
permissions:
|
|
pages: write
|
|
id-token: write
|
|
environment:
|
|
name: github-pages
|
|
url: ${\{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v1
|
|
#- name: Publish Documentation
|
|
# env:
|
|
# ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# BRANCH: gh-pages
|
|
# DOCSFOLDER: artifacts/docs_site
|
|
# shell: cmd
|
|
# run: |
|
|
# cd %DOCSFOLDER%
|
|
# git init
|
|
# git config --local user.name "%GITHUB_ACTOR%"
|
|
# git config --local user.email "%GITHUB_ACTOR%@users.noreply.github.com"
|
|
# git config --local core.autocrlf false
|
|
# git add .
|
|
# git commit -m "Auto-update doc from commit %GITHUB_SHA%"
|
|
# git push --force https://%ACCESS_TOKEN%@github.com/%GITHUB_REPOSITORY%.git master:%BRANCH%
|
|
# rmdir .git /S /Q
|
|
|