Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run actions/cache@v4 出现问题,请大佬指教 #771

Closed
Leerol opened this issue Feb 3, 2025 · 8 comments
Closed

Run actions/cache@v4 出现问题,请大佬指教 #771

Leerol opened this issue Feb 3, 2025 · 8 comments

Comments

@Leerol
Copy link

Leerol commented Feb 3, 2025

自动同步数据的时候,发现失败的情况,查了日志发现Run actions/cache@v4 出现失败,请大佬指教,如图

Image

@Leerol
Copy link
Author

Leerol commented Feb 3, 2025

现在的代码如下:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
# if your default branches is not master, please change it here
ref: master

  - name: Cache Data Files
    if: inputs.save_data_in_github_cache
    uses: actions/cache@v4
    with:
      path: |
        activities
        assets
        GPX_OUT
        TCX_OUT
        FIT_OUT
        Workouts
        run_page/data.db
        src/static/activities.json
        imported.json
      key: ${{ inputs.data_cache_prefix }}-${{ github.sha }}-${{ github.run_id }}
      restore-keys: |
        ${{ inputs.data_cache_prefix }}-${{ github.sha }}-
        ${{ inputs.data_cache_prefix }}-

  - name: Setup Node.js environment
    uses: actions/setup-node@v4
    with:
      node-version: '20'
  - name: Enable corepack
    run: corepack enable

  - name: Get pnpm store directory
    shell: bash
    run: |
      echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

  - uses: actions/cache@v4
    name: Setup pnpm cache
    with:
      path: ${{ env.STORE_PATH }}
      key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
      restore-keys: |
        ${{ runner.os }}-pnpm-store-

@yihong0618
Copy link
Owner

是的,我今天修复一下

@yihong0618 yihong0618 pinned this issue Feb 3, 2025
@yihong0618
Copy link
Owner

修复了,更新下代码

@Leerol
Copy link
Author

Leerol commented Feb 3, 2025

好的,感谢大佬,可以啦

@Leerol Leerol closed this as completed Feb 3, 2025
@shugoal
Copy link

shugoal commented Feb 6, 2025

修复了,更新下代码

请教一下,如何更新

Error: This request has been automatically failed because it uses a deprecated version of actions/upload-artifact: v3. Learn more: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/

@shugoal
Copy link

shugoal commented Feb 6, 2025

请问是修改这个文件么
.github/workflows/gh-pages.yml ?

把下面这些替换一下?

steps:

Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it

  • uses: actions/checkout@v4
    with:

if your default branches is not master, please change it here

ref: master

  • name: Cache Data Files
    if: inputs.save_data_in_github_cache
    uses: actions/cache@v4
    with:
    path: |
    activities
    assets
    GPX_OUT
    TCX_OUT
    FIT_OUT
    Workouts
    run_page/data.db
    src/static/activities.json
    imported.json
    key: ${{ inputs.data_cache_prefix }}-${{ github.sha }}-${{ github.run_id }}
    restore-keys: |
    ${{ inputs.data_cache_prefix }}-${{ github.sha }}-
    ${{ inputs.data_cache_prefix }}-

  • name: Setup Node.js environment
    uses: actions/setup-node@v4
    with:
    node-version: '20'

  • name: Enable corepack
    run: corepack enable

  • name: Get pnpm store directory
    shell: bash
    run: |
    echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

  • uses: actions/cache@v4
    name: Setup pnpm cache
    with:
    path: ${{ env.STORE_PATH }}
    key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
    restore-keys: |
    ${{ runner.os }}-pnpm-store-

@yihong0618
Copy link
Owner

你要是不太明白怎么弄可以问 gpt 要是还不明白建议从头操作一遍,否则很容易出错

@shugoal
Copy link

shugoal commented Feb 9, 2025

你要是不太明白怎么弄可以问 gpt 要是还不明白建议从头操作一遍,否则很容易出错

你好,感谢回复。我是用的这个 https://github.com/frhfeng/workouts_page
我的代码基础非常薄弱,这些对我已经超纲了。 请问是不是要修改这个文件啊,或者是其它方面的操作,感谢。祝春节愉快,一会问问那个AI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants