DocFxDocumentPages #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DocFxDocumentPages | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ aigio-win10ltsc-vm ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: dev8 | |
- name: Setup .NET | |
if: ${{ matrix.os != 'aigio-win10ltsc-vm' }} | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 8.0.x | |
- name: Install Android SDK | |
if: ${{ matrix.os != 'aigio-win10ltsc-vm' }} | |
run: dotnet workload install android | |
- name: Install iOS SDK | |
if: ${{ matrix.os != 'aigio-win10ltsc-vm' }} | |
run: dotnet workload install ios | |
- name: Install macOS SDK | |
if: ${{ matrix.os != 'aigio-win10ltsc-vm' }} | |
run: dotnet workload install macos | |
- name: Install Mac Catalyst SDK | |
if: ${{ matrix.os != 'aigio-win10ltsc-vm' }} | |
run: dotnet workload install maccatalyst | |
- name: Install Maui | |
if: ${{ matrix.os != 'aigio-win10ltsc-vm' }} | |
run: dotnet workload install maui | |
- name: Install wasm-tools | |
if: ${{ matrix.os != 'aigio-win10ltsc-vm' }} | |
run: dotnet workload install wasm-tools | |
- name: Verify dotnet info | |
run: dotnet --info | |
- name: Build tools | |
run: dotnet build -c Release src\Tools.Build\Tools.Build.csproj --nologo -v q /property:WarningLevel=1 | |
- name: Build projects | |
run: .\src\artifacts\bin\Tools.Build\release\Tools.Build.exe build | |
- name: Install DocFX | |
run: dotnet tool update -g docfx | |
- name: Build docfx | |
run: docfx ./docfx.json | |
- name: Checkout docs | |
uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
path: docs | |
# Sync the site | |
- name: Clear docs repo | |
run: Get-ChildItem -Force -Exclude .git | ForEach-Object { Remove-Item -Recurse -Verbose -Force $_ } | |
working-directory: ./docs | |
- name: Sync new content | |
run: Copy-Item -Recurse -Verbose -Force "$env:GITHUB_WORKSPACE/_site/*" "$env:GITHUB_WORKSPACE/docs" | |
working-directory: ./docs | |
# update docs | |
- name: Commit to gh-pages and push | |
run: | | |
$ErrorActionPreference = "Continue" | |
git add -A | |
git diff HEAD --exit-code | |
if ($LASTEXITCODE -eq 0) { | |
Write-Host "No changes to commit!" | |
} else { | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git commit -m "Updated _site from commit $env:GITHUB_SHA on $env:GITHUB_REF" | |
git remote set-url origin https://x-access-token:${{ secrets.RMBADMIN_TOKEN }}@github.com/${{ github.repository }} | |
git push origin gh-pages | |
} | |
working-directory: ./docs |