瀏覽代碼

CI: save cache on each run

SukkaW 2 年之前
父節點
當前提交
e4e51b69a1
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      .github/workflows/main.yml

+ 6 - 2
.github/workflows/main.yml

@@ -21,8 +21,12 @@ jobs:
       - name: Cache cache.db
         uses: actions/cache@v3
         with:
-          path: .cache
-          key: ${{ runner.os }}-v1
+          path: |
+            .cache
+          key: ${{ runner.os }}-v1-${{ github.sha }}
+          # If source files changed but packages didn't, rebuild from a prior cache.
+          restore-keys: |
+            ${{ runner.os }}-v1
       - run: bun install
       - run: bun run build
       - name: Deploy