diff --git a/README.md b/README.md new file mode 100644 index 0000000..07c42b7 --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# Action-cached-git-fls-pull + +This action is used to do git pull LFS leveraging github action cache + +## Requirement + +Your have to checkout your project containing the Dockerfile before running the action. Be sure to set lfs to false. + +## Usage + +See [action.yml](action.yml) + +Basic: + +```yaml +steps: +- name: Checkout repository + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + +- name: Pull LFS + uses: cresh-io/action-cached-git-lfs-pull@v1 +``` + +## Thanks + +This composite is inspired of the great works of : [action-cached-lfs-checkout](https://github.com/nschloe/action-cached-lfs-checkout) + +## License + +The scripts and documentation in this project are released under the [MIT License](LICENSE) diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..064da58 --- /dev/null +++ b/action.yml @@ -0,0 +1,27 @@ +name: Git lfs pull using github action cache + +description: This action is used to do git pull LFS leveraging github action cache + +branding: + icon: "download" + color: "purple" + +runs: + using: "composite" + steps: + - name: Create LFS file list + run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id + shell: bash + + - name: Restore LFS cache + uses: actions/cache@v2 + id: lfs-cache + with: + path: .git/lfs + key: lfs-${{ hashFiles('.lfs-assets-id') }} + restore-keys: | + lfs- + + - name: Git LFS Pull + run: git lfs pull + shell: bash