From a6587a42589a0a5062ceca86669d75910ffe62ff Mon Sep 17 00:00:00 2001 From: Kevin Peng Date: Sun, 20 Apr 2025 07:17:34 +0800 Subject: [PATCH] update deploy workflow to include image conversion dependencies and processing --- .github/workflows/deploy.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 73fa26e..0ade3a3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,8 +18,10 @@ jobs: with: node-version: '16' - - name: Install dependencies for minification + - name: Install dependencies for minification and image conversion run: | + sudo apt-get update + sudo apt-get install -y webp npm install -g uglify-js csso-cli - name: Build and minify project @@ -36,6 +38,10 @@ jobs: [ -e "$file" ] || continue uglifyjs "$file" -o "dist/js/$(basename "${file%.js}.min.js")" done + for file in src/images/*.{png,jpg,jpeg}; do + [ -e "$file" ] || continue + cwebp "$file" -o "dist/images/$(basename "${file%.*}.webp")" + done - name: Deploy to gh-pages uses: peaceiris/actions-gh-pages@v4