From cd6013f75be199b827c1dc685f3e23157c050918 Mon Sep 17 00:00:00 2001 From: Garry O'Donnell Date: Tue, 25 Jul 2023 10:28:16 +0000 Subject: [PATCH 1/3] Only pull LFS files when building release container --- .github/workflows/container.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 5296f5b2..172a8f10 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -23,7 +23,7 @@ jobs: - name: Checkout with LFS uses: actions/checkout@v3.5.3 with: - lfs: true + lfs: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} - name: Generate Image Name run: echo IMAGE_REPOSITORY=ghcr.io/$(echo "${{ github.repository }}-${{ matrix.target }}" | tr '[:upper:]' '[:lower:]' | tr '[_]' '[\-]') >> $GITHUB_ENV From cfd6a95ce589caa3d44a7fbaf44a21c0a50b8972 Mon Sep 17 00:00:00 2001 From: Garry O'Donnell Date: Tue, 25 Jul 2023 10:31:39 +0000 Subject: [PATCH 2/3] Cache LFS files in container workflow --- .github/workflows/container.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 172a8f10..65d98d26 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -22,8 +22,18 @@ jobs: steps: - name: Checkout with LFS uses: actions/checkout@v3.5.3 + + - name: List LFS Files + run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-file-ids + + - name: Cache LFS Files + uses: actions/cache@v1.2.1 with: - lfs: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} + path: ./git/lfs + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-asset-ids') }} + + - name: Pull LFS Files + run: git lfs pull - name: Generate Image Name run: echo IMAGE_REPOSITORY=ghcr.io/$(echo "${{ github.repository }}-${{ matrix.target }}" | tr '[:upper:]' '[:lower:]' | tr '[_]' '[\-]') >> $GITHUB_ENV From ccb1636a8fb8b574c7791847b76e9a19817a1505 Mon Sep 17 00:00:00 2001 From: Garry O'Donnell Date: Wed, 30 Aug 2023 09:32:13 +0000 Subject: [PATCH 3/3] Fix cache key hashed file name --- .github/workflows/container.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 65d98d26..56524b3d 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -30,7 +30,7 @@ jobs: uses: actions/cache@v1.2.1 with: path: ./git/lfs - key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-asset-ids') }} + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-file-ids') }} - name: Pull LFS Files run: git lfs pull