ci: caching LFS files

This commit is contained in:
2025-06-19 08:52:30 +02:00
parent 4e7f27f51e
commit 7f55b444fb

View File

@ -15,6 +15,17 @@ runs:
uses: actions/checkout@v3
with:
lfs: false
- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v3
id: lfs-cache
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}
- name: Checkout LFS
if: ${{ inputs.checkout-version == '3' }}
run: |
@ -28,11 +39,25 @@ runs:
/usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }}
/usr/bin/git lfs checkout
/usr/bin/git add .
/usr/bin/git reset --hard
- name: Checkout
if: ${{ inputs.checkout-version == '4' }}
uses: actions/checkout@v4
with:
lfs: false
- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v3
id: lfs-cache
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}
- name: Checkout LFS
if: ${{ inputs.checkout-version == '4' }}
run: |
@ -46,3 +71,5 @@ runs:
/usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }}
/usr/bin/git lfs checkout
/usr/bin/git add .
/usr/bin/git reset --hard