From 83d590e790c2c2c3163bcbeef18b08dfccf531cd Mon Sep 17 00:00:00 2001 From: Gautam Sheth Date: Thu, 21 May 2026 22:53:36 +0300 Subject: [PATCH 1/2] Update documentation build workflows and Dockerfiles to use latest versions of DocFX and .NET --- .github/workflows/builddocsite.yml | 19 ++++++++++++------- .github/workflows/checkdocumentationbuild.yml | 13 +++++++++---- pages/Dockerfile-Linux | 9 ++++----- pages/Dockerfile-Windows | 11 +++++++---- pages/articles/buildingdocker.md | 6 +++--- .../material/partials/head.tmpl.partial | 2 +- .../material/partials/scripts.tmpl.partial | 2 +- 7 files changed, 37 insertions(+), 25 deletions(-) diff --git a/.github/workflows/builddocsite.yml b/.github/workflows/builddocsite.yml index 3e08d07ed3..2d88a6fccd 100644 --- a/.github/workflows/builddocsite.yml +++ b/.github/workflows/builddocsite.yml @@ -7,6 +7,10 @@ on: permissions: read-all +env: + DOCFX_VERSION: 2.78.5 + DOTNET_VERSION: 10.x + jobs: documentation: runs-on: ubuntu-latest @@ -18,26 +22,27 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Checkout master branch - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: ref: master path: master - name: Checkout dev branch - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: ref: dev path: dev - name: Checkout gh-pages branch - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: ref: gh-pages path: gh-pages - - name: Setup .NET 7.0 - uses: actions/setup-dotnet@v4 + - name: Setup .NET 10.0 + uses: actions/setup-dotnet@v5 with: - dotnet-version: 7.x + dotnet-version: ${{ env.DOTNET_VERSION }} - - run: dotnet tool install -g docfx --version 2.72.1 + - name: Install DocFX + run: dotnet tool install -g docfx --version ${{ env.DOCFX_VERSION }} - name: Build docs shell: pwsh diff --git a/.github/workflows/checkdocumentationbuild.yml b/.github/workflows/checkdocumentationbuild.yml index 846e437985..8ec8c14f1e 100644 --- a/.github/workflows/checkdocumentationbuild.yml +++ b/.github/workflows/checkdocumentationbuild.yml @@ -10,6 +10,10 @@ on: permissions: read-all +env: + DOCFX_VERSION: 2.78.5 + DOTNET_VERSION: 10.x + jobs: docfx: @@ -27,12 +31,13 @@ jobs: with: ref: gh-pages path: gh-pages - - name: Setup .NET 7.0 - uses: actions/setup-dotnet@v4 + - name: Setup .NET 10.0 + uses: actions/setup-dotnet@v5 with: - dotnet-version: 7.x + dotnet-version: ${{ env.DOTNET_VERSION }} - - run: dotnet tool install -g docfx --version 2.72.1 + - name: Install DocFX + run: dotnet tool install -g docfx --version ${{ env.DOCFX_VERSION }} - name: Build docs shell: pwsh diff --git a/pages/Dockerfile-Linux b/pages/Dockerfile-Linux index 6cceeb35b5..4134ebc245 100644 --- a/pages/Dockerfile-Linux +++ b/pages/Dockerfile-Linux @@ -1,6 +1,5 @@ -FROM mono:6.12.0.182 +FROM mcr.microsoft.com/dotnet/sdk:10.0 -RUN apt update && apt upgrade -y && apt install wget unzip -y; -RUN wget wget https://github.com/dotnet/docfx/releases/download/v2.51/docfx.zip; \ - unzip docfx.zip -d /usr/local/lib/docfx; \ - chmod +x /usr/local/lib/docfx/docfx.exe; \ +ARG DOCFX_VERSION=2.78.5 + +RUN dotnet tool install docfx --tool-path /usr/local/bin --version ${DOCFX_VERSION} diff --git a/pages/Dockerfile-Windows b/pages/Dockerfile-Windows index 5ad0eb953d..b23131814a 100644 --- a/pages/Dockerfile-Windows +++ b/pages/Dockerfile-Windows @@ -1,6 +1,9 @@ -FROM mcr.microsoft.com/windows/servercore:10.0.17763.2366-amd64 +FROM mcr.microsoft.com/dotnet/sdk:10.0-windowsservercore-ltsc2022 SHELL ["powershell", "-command"] -RUN $ProgressPreference = 'SilentlyContinue'; \ - Invoke-WebRequest https://github.com/dotnet/docfx/releases/download/v2.51/docfx.zip -OutFile $env:TEMP\docfx.zip; \ - Expand-Archive $env:TEMP\docfx.zip $env:TEMP\docfx; + +ARG DOCFX_VERSION=2.78.5 + +RUN dotnet tool install docfx --tool-path C:\tools\docfx --version $env:DOCFX_VERSION + +ENV PATH="C:\tools\docfx;${PATH}" diff --git a/pages/articles/buildingdocker.md b/pages/articles/buildingdocker.md index ecb661e783..c4e76daa2a 100644 --- a/pages/articles/buildingdocker.md +++ b/pages/articles/buildingdocker.md @@ -11,7 +11,7 @@ docker build . -f ./pages/Dockerfile-Linux -t pnp.powershell-pages-build ## Build Documentation ```bash -docker run --rm -it -v $(pwd)/pages:/home pnp.powershell-pages-build /usr/bin/mono /usr/local/lib/docfx/docfx.exe build /home/docfx.json +docker run --rm -it -v $(pwd)/pages:/workspace -w /workspace pnp.powershell-pages-build docfx build docfx.json ``` ## Clean documentation @@ -32,7 +32,7 @@ docker build . -f ./pages/Dockerfile-Windows -t pnp.powershell-pages-build ## Build Documentation ```bat -docker run --rm -it -v %cd%\pages:C:\workplace pnp.powershell-pages-build powershell -c Start-Process -NoNewWindow -FilePath $env:TEMP\docfx\docfx.exe -ArgumentList build, C:\workplace\docfx.json -Wait +docker run --rm -it -v %cd%\pages:C:\workspace -w C:\workspace pnp.powershell-pages-build docfx build docfx.json ``` ## Clean documentation @@ -53,7 +53,7 @@ docker build . -f ./pages/Dockerfile-Windows -t pnp.powershell-pages-build ## Build Documentation ```powershell -docker run --rm -it -v ${pwd}\pages:C:\workplace pnp.powershell-pages-build powershell -c "Start-Process -NoNewWindow -FilePath `$env:TEMP\docfx\docfx.exe -ArgumentList build, C:\workplace\docfx.json -Wait" +docker run --rm -it -v ${pwd}\pages:C:\workspace -w C:\workspace pnp.powershell-pages-build docfx build docfx.json ``` ## Clean documentation diff --git a/pages/templates/material/partials/head.tmpl.partial b/pages/templates/material/partials/head.tmpl.partial index 94497566a2..7f76dcae13 100644 --- a/pages/templates/material/partials/head.tmpl.partial +++ b/pages/templates/material/partials/head.tmpl.partial @@ -9,7 +9,7 @@ {{#_description}}{{/_description}} - + diff --git a/pages/templates/material/partials/scripts.tmpl.partial b/pages/templates/material/partials/scripts.tmpl.partial index 868b25ee92..e40333e309 100644 --- a/pages/templates/material/partials/scripts.tmpl.partial +++ b/pages/templates/material/partials/scripts.tmpl.partial @@ -1,6 +1,6 @@ {{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}} - +