Skip to content

Update photography.html #30

Update photography.html

Update photography.html #30

name: Compress Images
on:
push:
jobs:
compress-images:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
persist-credentials: true # Allows GitHub Actions to push changes back
- name: Compress Images
uses: ClydeDz/[email protected]
with:
input-directory: assets/photos
output-directory: assets/compressed_photos
jpg-compression-quality: 40
png-compression-quality: 0.4
gif-compression-quality: 4
- name: Commit and Push Changes
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add assets/compressed_photos
# Check if there are any changes to commit
if ! git diff-index --quiet HEAD; then
git commit -m "Compress images and save output"
git push
else
echo "No changes to commit."
fi