Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 10 additions & 29 deletions .github/workflows/Deploy MkDocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ on:
pull_request:
branches:
- main
- testing
paths: # Only deploy MkDocs when the contents of the docs folder change or when this workflow changes
- 'Docs/**'
- '.github/workflows/Deploy MkDocs.yml'
- './mkdocs.yml'
push:
branches:
#- main # The branch you want to deploy from
- testing
- main # The branch you want to deploy from
paths: # Only deploy MkDocs when the contents of the docs folder change or when this workflow changes
- 'Docs/**'
- '.github/workflows/Deploy MkDocs.yml'
Expand All @@ -20,7 +22,12 @@ on:

jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

steps:
- name: ✅ Checkout Repository
Expand All @@ -40,29 +47,3 @@ jobs:
run: |
mkdocs build
mkdocs gh-deploy --force

# Combine markdown files to create the MkDocs index and the repository readme file.
- name: 📖 Update Index & Readme
shell: pwsh
run: |
Write-Output 'Updating Docs\Index.md & \Readme.md'
# Temporarily disabled until this can be wrapped in a PR that is submitted and merged by the workflow.
# Copy-Item README.md Docs/index.md

# [int16]$LineNumber = (Select-String -Path '.\docs\index.md' -Pattern 'Summary' -List).LineNumber + 1
# $IndexTop = Get-Content -Path ./docs/index.md -TotalCount $LineNumber
# $ModuleContent = Get-Content -Path ./docs/Locksmith.md | Select-Object -Skip 12
# $FooterContent = "`n</Details>`n"
# $CombinedContent = $IndexTop + $ModuleContent + $FooterContent
# $CombinedContent | Set-Content -Path ./docs/index.md
# $ModuleContent = $ModuleContent.Replace( '](' , '](./docs/' )
# $CombinedContent = $IndexTop + $ModuleContent
# $CombinedContent | Set-Content -Path ./README.md
# Copy-Item ./docs/index.md ./README.md

# NOTE: git-auto-commit-action only runs on Linux-based platforms.
- name: 💾 Commit Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'Copy MkDocs README to index'
file_pattern: 'README.md Docs/index.md'