浏览代码

CI: use date as cache key

SukkaW 2 年之前
父节点
当前提交
702b9d9596
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      .github/workflows/main.yml

+ 4 - 1
.github/workflows/main.yml

@@ -18,12 +18,15 @@ jobs:
       - uses: oven-sh/setup-bun@v1
         with:
           bun-version: canary
+      - name: Get current date
+        id: date
+        run: echo "date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
       - name: Cache cache.db
         uses: actions/cache@v3
         with:
           path: |
             .cache
-          key: ${{ runner.os }}-v1-${{ github.sha }}
+          key: ${{ runner.os }}-v1-${{ steps.date.outputs.date }}
           # If source files changed but packages didn't, rebuild from a prior cache.
           restore-keys: |
             ${{ runner.os }}-v1