Update .gitea/workflows/compressimages.yml
All checks were successful
Sonar Check / SonarQube Scan (pull_request) Successful in 1m14s

This commit is contained in:
2026-04-16 15:00:44 +00:00
parent 358458117c
commit b755b8ac7e

View File

@@ -26,6 +26,13 @@ jobs:
optimize: optimize:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# 🚀 Use your internal image (no apt needed)
container:
image: git.wdipl.com/wdi-public/image-optimizer:latest
credentials:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
steps: steps:
# 🔀 Decide branch (PR vs manual) # 🔀 Decide branch (PR vs manual)
- name: Determine Branch - name: Determine Branch
@@ -44,33 +51,6 @@ jobs:
fetch-depth: 0 fetch-depth: 0
ref: ${{ steps.branch.outputs.branch }} ref: ${{ steps.branch.outputs.branch }}
# 🚀 FIX: Ubuntu 24 mirror replacement (covers .list + .sources)
- name: Use faster apt mirror
run: |
echo "🔧 Replacing apt mirrors..."
sudo find /etc/apt -type f -name "*.list" \
-exec sed -i 's|http://archive.ubuntu.com|http://in.archive.ubuntu.com|g' {} +
sudo find /etc/apt -type f -name "*.list" \
-exec sed -i 's|http://security.ubuntu.com|http://in.archive.ubuntu.com|g' {} +
sudo find /etc/apt -type f -name "*.sources" \
-exec sed -i 's|http://archive.ubuntu.com|http://in.archive.ubuntu.com|g' {} +
sudo find /etc/apt -type f -name "*.sources" \
-exec sed -i 's|http://security.ubuntu.com|http://in.archive.ubuntu.com|g' {} +
# 🔍 Debug (optional but useful)
- name: Verify apt sources
run: |
echo "🔍 Current apt sources:"
grep -r "ubuntu.com" /etc/apt || true
# 📦 Install tools
- name: Install Image Tools
run: |
sudo apt-get update
sudo apt-get install -y imagemagick jpegoptim pngquant
# 🖼 Resize images # 🖼 Resize images
- name: Resize Oversized Images - name: Resize Oversized Images
run: | run: |