ci: fix APT cache redundant uploads with lowercase keys and conditional save
All checks were successful
Deploy Documentation / build-and-deploy (push) Successful in 51s
All checks were successful
Deploy Documentation / build-and-deploy (push) Successful in 51s
This commit is contained in:
parent
e4a8a55a28
commit
b6697cb555
1 changed files with 7 additions and 5 deletions
|
|
@ -14,13 +14,14 @@ jobs:
|
|||
|
||||
# 1. 기존 APT 캐시 복원 (가장 최근 상태 불러오기)
|
||||
- name: Restore APT Cache
|
||||
id: restore-apt
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: /var/cache/apt/archives
|
||||
# 매칭되지 않는 임시 키를 사용하여 항상 restore-keys가 작동하도록 유도
|
||||
key: ${{ runner.os }}-apt-temp
|
||||
key: linux-apt-temp
|
||||
restore-keys: |
|
||||
${{ runner.os }}-apt-
|
||||
linux-apt-
|
||||
|
||||
# 2. 시스템 패키지 설치 및 구버전 찌꺼기 청소
|
||||
- name: Install System Packages
|
||||
|
|
@ -52,20 +53,21 @@ jobs:
|
|||
|
||||
# 4. 계산된 해시값을 Key로 캐시 저장
|
||||
- name: Save APT Cache
|
||||
if: steps.restore-apt.outputs.cache-matched-key != format('linux-apt-{0}', steps.apt-hash.outputs.hash)
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: /var/cache/apt/archives
|
||||
# 내용물에 변화가 없으면 해시가 동일하므로 업로드를 자동으로 건너뜁니다 (Skip)
|
||||
key: ${{ runner.os }}-apt-${{ steps.apt-hash.outputs.hash }}
|
||||
key: linux-apt-${{ steps.apt-hash.outputs.hash }}
|
||||
|
||||
- name: Cache Python Virtual Environment
|
||||
id: cache-venv
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: venv
|
||||
key: ${{ runner.os }}-venv-${{ hashFiles('requirements.txt') }}
|
||||
key: linux-venv-${{ hashFiles('requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-venv-
|
||||
linux-venv-
|
||||
|
||||
- name: Install Python Requirements
|
||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue