File tree Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Original file line number Diff line number Diff line change 6262 draft : false
6363 prerelease : ${{ github.ref != 'refs/heads/main' }}
6464
65+ - name : Write MD Docs with PlatyPS
66+ run : .\build.ps1 -WriteMdDocs -SemVer "${{ steps.gitversion.outputs.LegacySemVerPadded }}"
67+ shell : pwsh
68+
69+ - name : Deploy docs
70+ uses : mhausenblas/mkdocs-deploy-gh-pages@nomaterial
71+ # Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme
72+ env :
73+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74+ CONFIG_FILE : .\mkdocs_template\mkdocs.yml
75+ EXTRA_PACKAGES : build-base
76+ # GITHUB_DOMAIN: github.myenterprise.com
77+
6578 - name : Publish Module
6679 if : ${{ github.ref == 'refs/heads/main' }}
6780 run : .\build.ps1 -DeployToGallery -SemVer "${{ steps.gitversion.outputs.LegacySemVerPadded }}"
Original file line number Diff line number Diff line change @@ -16,6 +16,18 @@ param(
1616 [Switch ]
1717 $DeployToGallery ,
1818
19+ [Parameter ()]
20+ [Switch ]
21+ $WriteMdDocs ,
22+
23+ [Parameter ()]
24+ [Switch ]
25+ $MkDocsPublish ,
26+
27+ [Parameter ()]
28+ [Switch ]
29+ $GHPages ,
30+
1931 [Parameter ()]
2032 [Switch ]
2133 $Choco ,
@@ -92,5 +104,40 @@ process {
92104 choco push $_.FullName - s https:// push.chocolatey.org -- api- key= " '$ ( $env: ChocoApiKey ) '"
93105 }
94106 }
107+
108+ $WriteMdDocs {
109+ if (Test-Path $root \Output\BeautifulDocs) {
110+ if ($env: PSModulePath.Split (' ;' ) -notcontains " $root \Output" ) {
111+ $env: PSModulePath = " $root \Output;$env: PSModulePath "
112+ }
113+ Import-Module BeautifulDocs - Force
114+ Import-Module PlatyPS - Force
115+
116+ New-MarkdownHelp - Module BeautifulDocs - OutputFolder $root \docs
117+
118+ }
119+ }
120+
121+ $MkDocsPublish {
122+ $mkDocsRoot = Join-Path $root ' mkdocs_template'
123+ Push-Location $mkDocsRoot
124+ $mkDocsArgs = @ (' build' )
125+
126+ & ' C:\Python39\Scripts\mkdocs.exe' @mkDocsArgs
127+ }
128+
129+ $GHPages {
130+ # Write your PowerShell commands here.
131+ git config -- global user.name ' Stephen Valdinger'
132+ git config
-- global user.email
' [email protected] ' 133+ git remote rm origin
134+ $url = ' https://steviecoaster:' + $env: GH_TOKEN + ' @github.com/steviecoaster/BeautifulDocs.git'
135+ git remote add origin $url
136+
137+ $mkDocsArgs = @ (' gh-deploy' , ' --force' )
138+
139+ Set-Location .\mkdocs_template
140+ & ' C:\Python39\Scripts\mkdocs.exe' @mkDocsArgs
141+ }
95142 }
96143}
You can’t perform that action at this time.
0 commit comments