Update README.md #20
This file contains 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 | |
permissions: | |
contents: write | |
deployments: write | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
pages: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.12' | |
- name: Setup Dependencies | |
run: pip install -r requirements.txt | |
- name: Build | |
shell: pwsh | |
run: |- | |
python -m mkdocs build | |
python -m mkdocs build --no-directory-urls --site-dir site_ | |
foreach ($file in Get-ChildItem site_ -Recurse -File) { | |
$rp = Resolve-Path -Relative $file -RelativeBasePath site_ | |
$match_path = Join-Path "./site" $rp | |
if (!(Test-Path $match_path)) { | |
Copy-Item $file $match_path | |
} | |
} | |
- name: Publish | |
run: |- | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
ghp-import site --push | |
- uses: actions/[email protected] | |
with: | |
path: './site' |