From 5ba5a02c76bfa5c3d46b0dd38cdfa0d9055029f4 Mon Sep 17 00:00:00 2001 From: lirtual Date: Sat, 21 Dec 2024 22:32:35 +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 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/optimize-assets.yml b/.github/workflows/optimize-assets.yml index e904ba4737d..6c7da3a4b36 100644 --- a/.github/workflows/optimize-assets.yml +++ b/.github/workflows/optimize-assets.yml @@ -18,19 +18,30 @@ jobs: node-version: '18' cache: 'npm' - # 添加 FFmpeg 缓存 + # 优化 FFmpeg 缓存 - name: Cache FFmpeg id: cache-ffmpeg uses: actions/cache@v3 with: - path: /usr/bin/ffmpeg - key: ${{ runner.os }}-ffmpeg + path: ~/.ffmpeg + key: ${{ runner.os }}-ffmpeg-${{ hashFiles('.github/workflows/optimize-assets.yml') }} + restore-keys: | + ${{ runner.os }}-ffmpeg- - name: Install FFmpeg if: steps.cache-ffmpeg.outputs.cache-hit != 'true' run: | 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: | + sudo cp ~/.ffmpeg/ffmpeg /usr/local/bin/ + sudo chmod +x /usr/local/bin/ffmpeg # 添加 node_modules 缓存 - name: Cache node_modules