Fix cache for mkdocs in CI #36
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: ci | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| sparse-checkout: | | |
| docs | |
| includes | |
| overrides | |
| ihm | |
| - name: Install pngquant | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pngquant | |
| - name: Configure Git Credentials | |
| run: | | |
| git config user.name github-actions[bot] | |
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: ".python-version" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.10.7" | |
| enable-cache: true | |
| - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
| - name: Restore MKDocs cache | |
| uses: actions/cache@v5 | |
| with: | |
| key: mkdocs-material-${{ env.cache_id }} | |
| path: .cache | |
| restore-keys: | | |
| mkdocs-material- | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Build and deploy website | |
| run: uv run mkdocs gh-deploy --force | |
| - name: Minimize uv cache | |
| run: uv cache prune --ci |