Update .gitea/workflows/compressimage.yml
All checks were successful
Klc-Learner-Frontend-CD / Deploying code in Server (push) Successful in 27s

This commit is contained in:
2026-04-13 11:36:58 +00:00
parent d7481497f0
commit 364762b206

View File

@@ -2,18 +2,12 @@ name: Enforce Image Standards
on:
pull_request:
branches:
- main
- beta
- testing
- client
- staging
- production
types: [opened, synchronize, reopened]
paths:
- '**.jpg'
- '**.jpeg'
- '**.png'
#workflow_dispatch:
- '**/*.jpg'
- '**/*.jpeg'
- '**/*.png'
workflow_dispatch:
jobs:
optimize:
@@ -23,6 +17,11 @@ jobs:
- 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
@@ -42,16 +41,3 @@ jobs:
run: |
find . -type f -iname "*.png" \
-exec pngquant --force --ext .png --quality=75-90 {} \;
- name: Commit Optimized Images
run: |
git config --global user.name "gitea-actions"
git config --global user.email "actions@local"
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Auto resize and optimize images"
git push origin HEAD:${{ gitea.head_ref }}
else
echo "No changes to commit"
fi