Update .gitea/workflows/compressimage.yml
All checks were successful
Klc-Learner-Frontend-CD / Deploying code in Server (push) Successful in 27s
All checks were successful
Klc-Learner-Frontend-CD / Deploying code in Server (push) Successful in 27s
This commit is contained in:
@@ -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
|
||||
@@ -41,17 +40,4 @@ jobs:
|
||||
- name: Optimize PNG
|
||||
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
|
||||
-exec pngquant --force --ext .png --quality=75-90 {} \;
|
||||
Reference in New Issue
Block a user