Skip to content

Delete assets/pet-image/1731305961414.jpeg #151

Delete assets/pet-image/1731305961414.jpeg

Delete assets/pet-image/1731305961414.jpeg #151

name: Image compressor workflow
on:
push:
branches:
- main
paths:
- "assets/pet-image/*.jpg"
- "assets/pet-image/*.jpeg"
jobs:
compress-images:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: main
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y imagemagick
- name: Make script executable
run: |
chmod +x compress-images.sh
- name: Compress images
run: |
./compress-images.sh
- name: Commit changes
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add .
git commit -m "Compress (${{ github.sha }})'s image"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}