Skip to content

Commit 925f18b

Browse files
committed
测试 缓存 MkDocs 依赖的安装结果(缓存 ~/.local 等安装产物,减少重复 pip install)
1 parent 35de487 commit 925f18b

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,18 @@ jobs:
2020
cache-dependency-path: |
2121
requirements.txt
2222
tools/requirements.txt
23+
- name: Cache user site-packages
24+
uses: actions/cache@v4
25+
with:
26+
path: ~/.local
27+
key: ${{ runner.os }}-pip-site-${{ hashFiles('requirements.txt', 'tools/requirements.txt') }}
28+
restore-keys: |
29+
${{ runner.os }}-pip-site-
2330
- name: Install dependencies
24-
run: pip install -r tools/requirements.txt -r requirements.txt
31+
run: |
32+
python -m pip install --upgrade pip
33+
python -m pip install --user -r tools/requirements.txt -r requirements.txt
34+
echo "$HOME/.local/bin" >> $GITHUB_PATH
2535
- name: Change permissions
2636
run: chmod 755 docs
2737
- name: Detect docs changes
@@ -65,4 +75,4 @@ jobs:
6575
with:
6676
github_token: ${{ secrets.GITHUB_TOKEN }}
6777
- name: Deploy with MkDocs
68-
run: mkdocs gh-deploy --force
78+
run: mkdocs gh-deploy --force

0 commit comments

Comments
 (0)