Documentation #15
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: Documentation | |
on: | |
push: | |
branches: | |
- "main" | |
paths: | |
- "docs/**" | |
- "types/**" | |
- "mkdocs.yml" | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
pages: write | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Install MD-Models | |
run: cargo install --path . | |
- name: Run the generation pipeline | |
run: sh .github/scripts/generate_types.sh | |
- name: "Update docs" | |
shell: "bash" | |
run: | | |
if [[ `git status --porcelain` ]]; then | |
git add --all | |
git config --global user.name 'MD-Models Bot' | |
git config --global user.email '[email protected]' | |
git commit -am "Doc update" | |
git push | |
else | |
echo "Nothing changed!" | |
fi | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
- uses: actions/cache@v4 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
- name: Install dependencies | |
run: pip install mkdocs-material jupyter nbconvert mkdocs-jupyter | |
- name: Deploy Documentation | |
run: mkdocs gh-deploy --force |