diff --git a/.github/workflows/Deploy MkDocs.yml b/.github/workflows/Deploy MkDocs.yml index 5093a5ba..faa77e2e 100644 --- a/.github/workflows/Deploy MkDocs.yml +++ b/.github/workflows/Deploy MkDocs.yml @@ -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' @@ -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 @@ -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`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'