Files
KLC-Hr-Dashboard-Frontend/.gitea/workflows/compressimage.yml
Rajendra Reddy 364762b206
All checks were successful
Klc-Learner-Frontend-CD / Deploying code in Server (push) Successful in 27s
Update .gitea/workflows/compressimage.yml
2026-04-13 11:36:58 +00:00

43 lines
1.1 KiB
YAML

name: Enforce Image Standards
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**/*.jpg'
- '**/*.jpeg'
- '**/*.png'
workflow_dispatch:
jobs:
optimize:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Debug Event
run: |
echo "Base: ${{ gitea.base_ref }}"
echo "Head: ${{ gitea.head_ref }}"
- name: Install Image Tools
run: |
sudo apt-get update
sudo apt-get install -y imagemagick jpegoptim pngquant
- name: Resize Oversized Images
run: |
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) \
-exec mogrify -resize 1920x1920\> {} \;
- name: Optimize JPEG
run: |
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) \
-exec jpegoptim --strip-all --max=85 {} \;
- name: Optimize PNG
run: |
find . -type f -iname "*.png" \
-exec pngquant --force --ext .png --quality=75-90 {} \;