Publish Docs #6217
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Docs | |
| on: | |
| workflow_dispatch: | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| defaults: | |
| run: | |
| shell: pwsh | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # to checkout the repo | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: PSModule/.github | |
| path: src | |
| fetch-depth: 0 | |
| - name: Compile docs | |
| run: | | |
| New-Item -Path .\docs -ItemType Directory -Force | |
| Copy-Item -Path .\src\profile\* -Destination .\docs -Force -Recurse | |
| Copy-Item -Path .\src\.github\*.md -Destination .\docs -Force -Recurse -Exclude 'pull_request_template.md' | |
| Get-ChildItem .\docs | Select-Object -ExpandProperty FullName | Sort-Object | |
| - uses: actions/configure-pages@v5 | |
| - name: Install mkdoks-material | |
| run: | | |
| pip install mkdocs-material | |
| pip install mkdocs-git-authors-plugin | |
| pip install mkdocs-git-revision-date-localized-plugin | |
| pip install mkdocs-git-committers-plugin-2 | |
| - name: Build mkdocs-material project | |
| run: | | |
| mkdocs build --config-file ./mkdocs.yml --site-dir _site/ | |
| - uses: actions/upload-pages-artifact@v3 | |
| deploy: | |
| needs: build | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |