docs: update docs #71
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: ci | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
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- | |
- run: pip install mkdocs-material mike | |
- name: Set up git user | |
run: | | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
- name: Deploy MkDocs site | |
run: | | |
if git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then | |
git config pull.rebase true | |
git pull origin gh-pages | |
else | |
echo "gh-pages branch does not exist yet. Skipping pull." | |
fi | |
version=$(date +%Y.%m.%d-%H.%M) | |
mike deploy --push --update-aliases $version latest | |
mike set-default --push latest |