Skip to content

Commit 88426be

Browse files
🩹 [Refactor]: Simplify Build-Docs workflow by removing unused input parameters and updating paths for clarity and consistency
1 parent 1764828 commit 88426be

File tree

1 file changed

+10
-41
lines changed

1 file changed

+10
-41
lines changed

‎.github/workflows/Build-Docs.yml

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,6 @@ on:
1212
description: The path to the source code of the module.
1313
required: false
1414
default: src
15-
ModulesOutputPath:
16-
type: string
17-
description: The path to the output directory for the modules.
18-
required: false
19-
default: outputs/modules
20-
ModuleArtifactName:
21-
type: string
22-
description: Name of the module artifact to upload.
23-
required: false
24-
default: module
25-
DocsOutputPath:
26-
type: string
27-
description: The path to the output directory for the documentation.
28-
required: false
29-
default: outputs/docs
30-
DocsArtifactName:
31-
type: string
32-
description: Name of the docs artifact to upload.
33-
required: false
34-
default: docs
35-
SiteOutputPath:
36-
type: string
37-
description: The path to the output directory for the site.
38-
required: false
39-
default: outputs/site
4015
Debug:
4116
type: boolean
4217
description: Enable debug output.
@@ -71,10 +46,6 @@ jobs:
7146
with:
7247
fetch-depth: 0
7348

74-
- name: Debug
75-
if: ${{ inputs.Debug }}
76-
uses: PSModule/Debug@v0
77-
7849
- name: Initialize environment
7950
uses: PSModule/Initialize-PSModule@v1
8051
with:
@@ -86,16 +57,14 @@ jobs:
8657
- name: Download module artifact
8758
uses: actions/download-artifact@v4
8859
with:
89-
name: ${{ inputs.ModuleArtifactName }}
90-
path: ${{ inputs.ModulesOutputPath }}
60+
name: module
61+
path: outputs/module
9162

9263
- name: Document module
9364
uses: PSModule/Document-PSModule@v1
9465
with:
9566
Name: ${{ inputs.Name }}
9667
Path: ${{ inputs.Path }}
97-
ModulesOutputPath: ${{ inputs.ModulesOutputPath }}
98-
DocsOutputPath: ${{ inputs.DocsOutputPath }}
9968
Debug: ${{ inputs.Debug }}
10069
Prerelease: ${{ inputs.Prerelease }}
10170
Verbose: ${{ inputs.Verbose }}
@@ -104,8 +73,8 @@ jobs:
10473
- name: Upload docs artifact
10574
uses: actions/upload-artifact@v4
10675
with:
107-
name: ${{ inputs.DocsArtifactName }}
108-
path: ${{ inputs.DocsOutputPath }}
76+
name: docs
77+
path: outputs/docs
10978
if-no-files-found: error
11079
retention-days: 1
11180

@@ -130,7 +99,7 @@ jobs:
13099
- name: Lint documentation
131100
uses: super-linter/super-linter/slim@latest
132101
env:
133-
FILTER_REGEX_INCLUDE: ${{ inputs.DocsOutputPath }}
102+
FILTER_REGEX_INCLUDE: outputs/docs
134103
DEFAULT_BRANCH: main
135104
DEFAULT_WORKSPACE: ${{ github.workspace }}
136105
ENABLE_GITHUB_ACTIONS_GROUP_TITLE: true
@@ -161,11 +130,11 @@ jobs:
161130
Verbose: ${{ inputs.Verbose }}
162131
Version: ${{ inputs.Version }}
163132
Script: |
164-
New-Item -Path "$env:GITHUB_WORKSPACE/${{ inputs.SiteOutputPath }}/docs/Functions" -ItemType Directory -Force
165-
Copy-Item -Path "$env:GITHUB_WORKSPACE/${{ inputs.DocsOutputPath }}/*" -Destination "$env:GITHUB_WORKSPACE/${{ inputs.SiteOutputPath }}/docs/Functions" -Recurse -Force
133+
New-Item -Path "$env:GITHUB_WORKSPACE/outputs/site/docs/Functions" -ItemType Directory -Force
134+
Copy-Item -Path "$env:GITHUB_WORKSPACE/outputs/docs/*" -Destination "$env:GITHUB_WORKSPACE/outputs/site/docs/Functions" -Recurse -Force
166135
$moduleName = [string]::IsNullOrEmpty('${{ inputs.Name }}') ? $env:GITHUB_REPOSITORY_NAME : '${{ inputs.Name }}'
167136
$ModuleSourcePath = Join-Path $PWD -ChildPath '${{ inputs.Path }}'
168-
$SiteOutputPath = Join-Path $PWD -ChildPath '${{ inputs.SiteOutputPath }}'
137+
$SiteOutputPath = Join-Path $PWD -ChildPath 'outputs/site'
169138
170139
LogGroup "Get folder structure" {
171140
Get-ChildItem -Recurse | Select-Object -ExpandProperty FullName | Sort-Object | Format-List
@@ -220,15 +189,15 @@ jobs:
220189
Get-ChildItem -Path $env:GITHUB_WORKSPACE -Recurse | Select-Object -ExpandProperty FullName | Sort-Object
221190
222191
- name: Build mkdocs-material project
223-
working-directory: ${{ inputs.SiteOutputPath }}
192+
working-directory: outputs/site
224193
shell: pwsh
225194
run: |
226195
LogGroup 'Build docs - mkdocs build - content' {
227196
Show-FileContent -Path mkdocs.yml
228197
}
229198
230199
LogGroup 'Build docs - mkdocs build' {
231-
mkdocs build --config-file mkdocs.yml --site-dir ${{ github.workspace }}/_site
200+
mkdocs build --config-file mkdocs.yml --site-dir ${{ inputs.Path }}/_site
232201
}
233202
234203
- uses: actions/upload-pages-artifact@v3

0 commit comments

Comments
 (0)