mirror of
https://github.com/linuxserver/docker-templates.git
synced 2026-02-20 00:48:49 +08:00
28 lines
1.1 KiB
YAML
28 lines
1.1 KiB
YAML
name: Resize images
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
paths:
|
|
- "linuxserver.io/img/**"
|
|
branches-ignore:
|
|
- "master"
|
|
|
|
jobs:
|
|
summary-syncer:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3.5.3
|
|
with:
|
|
fetch-depth: "0"
|
|
|
|
- name: Resize images
|
|
run: |
|
|
docker run -d --rm --name imagemagick -v $(pwd)/linuxserver.io:/inn -e FOLDER='/inn/img/' -e WIDTH=192 -e HEIGHT=192 ghcr.io/linuxserver/baseimage-alpine:3.19
|
|
docker exec imagemagick bash -c 'apk add --no-cache imagemagick && for match in $(find $FOLDER/ -type f \( -iname \*-logo.png -o -iname \*-icon.png \)); do SIZE=$(identify -format "%w-%h" $match); WDT=${SIZE%-*}; HGT=${SIZE#*-}; if (( $WDT > $WIDTH )) || (( $HGT > $HEIGHT )); then convert -define exclude-chunk=tIME $match -resize $WIDTHx$HEIGHT\> $match; fi; done'
|
|
docker stop imagemagick
|
|
|
|
git config --global user.email "ci@linuxserver.io"
|
|
git config --global user.name "LinuxServer-CI"
|
|
git commit -am "Automated Resizing of images" || :
|
|
git push || : |