add workflow for jpg2webp #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Convert images to webp | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
jpg2webp: | |
runs-on: ubuntu-latest | |
name: convert to webp | |
steps: | |
- name: download & install libwebp | |
run: | | |
wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.4.0-linux-x86-64.tar.gz | |
tar -xzf libwebp-1.4.0-linux-x86-64.tar.gz | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: convert | |
run: find . -type f -name "*.jpg" -exec sh -c ./llibwebp-1.4.0-linux-x86-64/cwebp -q 80 "$1" -o "${1%.jpg}.webp" && rm "$1"' _ {} \; | |
- name: push changes | |
run: | | |
git config --global user.name 'Your Name' | |
git config --global user.email '[email protected]' | |
git commit -am "chore: jpg2webp - $(date)" | |
git push | |