Skip to content

Commit

Permalink
docs.ps1: Added option to skip restore when done in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
NightOwl888 committed Oct 24, 2024
1 parent 1c68395 commit ba47ff4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Lucene-Net-Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
echo "$HOME/.dotnet/tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build docs
run: ./main-repo/websites/apidocs/docs.ps1 -Clean -LuceneNetVersion ${{ env.RELEASE_VERSION }}
run: ./main-repo/websites/apidocs/docs.ps1 -Clean -SkipToolRestore -LuceneNetVersion ${{ env.RELEASE_VERSION }}
shell: powershell

- name: Checkout Lucene.Net website
Expand Down
15 changes: 9 additions & 6 deletions websites/apidocs/docs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ param (
[switch] $DisableMetaData = $false,
[switch] $DisableBuild = $false,
[switch] $DisablePlugins = $false,
[switch] $SkipToolRestore = $false,
# LogLevel can be: Diagnostic, Verbose, Info, Warning, Error
[Parameter(Mandatory = $false)]
[string] $LogLevel = 'Warning',
Expand Down Expand Up @@ -62,12 +63,14 @@ $TocPath1 = Join-Path -Path $ApiDocsFolder -ChildPath "toc.yml"
$TocPath2 = Join-Path -Path $ApiDocsFolder -ChildPath "toc\toc.yml"
$BreadcrumbPath = Join-Path -Path $ApiDocsFolder -ChildPath "docfx.global.subsite.json"

# install docfx tool
Write-Host "Restoring docfx tool..."
$PreviousLocation = Get-Location
Set-Location $RepoRoot
dotnet tool restore
Set-Location $PreviousLocation
if ($SkipToolRestore -eq $false) {
# install docfx tool
Write-Host "Restoring docfx tool..."
$PreviousLocation = Get-Location
Set-Location $RepoRoot
dotnet tool restore
Set-Location $PreviousLocation
}

# delete anything that already exists
if ($Clean) {
Expand Down

0 comments on commit ba47ff4

Please sign in to comment.