Skip to content

Adjustments

Adjustments #87

Workflow file for this run

name: ⚡ Optimize PNG files
on:
push:
branches:
- '[0-9].[0-9]+**'
- snapshot
paths:
- '**/*.png'
jobs:
build:
name: ⚡ Optimize PNG files
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 📦 Install oxipng
uses: baptiste0928/cargo-install@v2
with:
crate: oxipng
version: latest
- name: 🧾 Get changed PNG files
id: changed-files
uses: tj-actions/changed-files@v41
with:
since_last_remote_commit: "true"
files: "**/*.png"
- name: ⚡ Optimize PNG files
run: oxipng -sZ -o 3 -i 0 --ng ${{ steps.changed-files.outputs.all_changed_files }}
- name : 🧾 Get optimized PNG files
id: optimized-files
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "all_optimized_files<<$EOF" >> $GITHUB_OUTPUT
echo "$(git status --porcelain | sed s/^...//)" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- name: ⬆️ Commit and push changes
if: ${{ steps.optimized-files.outputs.all_optimized_files }}
uses: swinton/[email protected]
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ steps.optimized-files.outputs.all_optimized_files }}
commit-message: ':zap: Optimize PNG files'
ref: ${{ github.ref }}