ci: caching LFS files
This commit is contained in:
29
action.yaml
29
action.yaml
@ -15,6 +15,17 @@ runs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
lfs: false
|
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
|
- name: Checkout LFS
|
||||||
if: ${{ inputs.checkout-version == '3' }}
|
if: ${{ inputs.checkout-version == '3' }}
|
||||||
run: |
|
run: |
|
||||||
@ -28,11 +39,25 @@ runs:
|
|||||||
|
|
||||||
/usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }}
|
/usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }}
|
||||||
/usr/bin/git lfs checkout
|
/usr/bin/git lfs checkout
|
||||||
|
/usr/bin/git add .
|
||||||
|
/usr/bin/git reset --hard
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
if: ${{ inputs.checkout-version == '4' }}
|
if: ${{ inputs.checkout-version == '4' }}
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
lfs: false
|
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
|
- name: Checkout LFS
|
||||||
if: ${{ inputs.checkout-version == '4' }}
|
if: ${{ inputs.checkout-version == '4' }}
|
||||||
run: |
|
run: |
|
||||||
@ -45,4 +70,6 @@ runs:
|
|||||||
git config --local lfs.transfer.maxretries 1
|
git config --local lfs.transfer.maxretries 1
|
||||||
|
|
||||||
/usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }}
|
/usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }}
|
||||||
/usr/bin/git lfs checkout
|
/usr/bin/git lfs checkout
|
||||||
|
/usr/bin/git add .
|
||||||
|
/usr/bin/git reset --hard
|
Reference in New Issue
Block a user