Skip to content

Commit 7db519a

Browse files
committed
chore: update workflows
1 parent 089e43d commit 7db519a

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

.github/workflows/deploy.yml

+24-10
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ jobs:
2222
build:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v4
25+
- name: Checkout main branch
26+
uses: actions/checkout@v4
2627
with:
2728
fetch-depth: 0
2829

29-
- uses: actions/checkout@v4
30+
- name: Checkout docs branch
31+
uses: actions/checkout@v4
3032
with:
3133
ref: docs
3234
path: mkdocs
@@ -41,19 +43,27 @@ jobs:
4143
4244
- name: Configure Git Credentials
4345
run: |
44-
git config user.name github-actions[bot]
45-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
46+
git config --global user.name github-actions[bot]
47+
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
4648
47-
- uses: actions/setup-python@v5
49+
- name: Setup Python
50+
uses: actions/setup-python@v5
4851
with:
4952
python-version: 3.x
5053

51-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
54+
- name: Restore pip cache
55+
uses: actions/cache@v4
56+
with:
57+
path: ~/.cache/pip
58+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
59+
restore-keys: |
60+
${{ runner.os }}-pip-
5261
53-
- uses: actions/cache@v4
62+
- name: Restore mkdocs-material cache
63+
uses: actions/cache@v4
5464
with:
55-
key: mkdocs-material-${{ env.cache_id }}
5665
path: .cache
66+
key: mkdocs-material-${{ env.cache_id }}
5767
restore-keys: |
5868
mkdocs-material-
5969
@@ -67,14 +77,15 @@ jobs:
6777
- name: Set MKDOCS_API_KEYS
6878
run: echo "MKDOCS_API_KEYS=${{ secrets.MKDOCS_API_KEYS }}" >> $GITHUB_ENV
6979

70-
- run: |
80+
- name: Build site
81+
run: |
7182
python3 main.py
7283
mkdocs build -f mkdocs.yml
7384
mkdocs build -f mkdocs-en.yml
7485
7586
- name: Generate CNAME
7687
run: echo "leetcode.doocs.org" > ./site/CNAME
77-
88+
7889
- name: Commit committer cache to docs branch
7990
if: github.ref == 'refs/heads/main'
8091
env:
@@ -92,6 +103,9 @@ jobs:
92103
cp "$CACHE_FILE" docs-cache/
93104
94105
cd docs-cache
106+
git config user.name github-actions[bot]
107+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
108+
95109
git add .git-committers-cache.json
96110
git commit -m "chore: update committer cache [skip ci]" || echo "No changes to commit"
97111
git push origin docs

0 commit comments

Comments
 (0)