From 06b77fb7ade989e6edd144d1f33198397fb8ef36 Mon Sep 17 00:00:00 2001 From: lirtual Date: Sat, 21 Dec 2024 23:03:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DFFmpeg=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/optimize-assets.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/optimize-assets.yml b/.github/workflows/optimize-assets.yml index 6c7da3a4b36..9faf9263f9b 100644 --- a/.github/workflows/optimize-assets.yml +++ b/.github/workflows/optimize-assets.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - fetch-depth: 0 # 获取完整历史以便进行比较 + fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v3 @@ -34,14 +34,20 @@ jobs: sudo apt-get update sudo apt-get install -y ffmpeg mkdir -p ~/.ffmpeg - which ffmpeg > ~/.ffmpeg/path cp $(which ffmpeg) ~/.ffmpeg/ - name: Setup FFmpeg from cache if: steps.cache-ffmpeg.outputs.cache-hit == 'true' run: | + mkdir -p ~/.ffmpeg sudo cp ~/.ffmpeg/ffmpeg /usr/local/bin/ sudo chmod +x /usr/local/bin/ffmpeg + # 验证 FFmpeg 是否可用 + ffmpeg -version || { + echo "Cached FFmpeg is not working, falling back to fresh install" + sudo apt-get update + sudo apt-get install -y ffmpeg + } # 添加 node_modules 缓存 - name: Cache node_modules