Skip to content

Update social media links in index.html #10

Update social media links in index.html

Update social media links in index.html #10

name: Image Optimization
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
optimize:
name: Optimize images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install optimization tools
run: |
npm init -y
npm install -D svgo imagemin-cli imagemin-mozjpeg imagemin-pngquant
- name: Optimize SVGs with SVGO
run: npx svgo -f assets --config=./.svgo.yml || true
- name: Optimize raster images (lossless)
run: npx imagemin "assets/*.{png,jpg,jpeg}" --out-dir=assets || true
- name: Commit optimized assets
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add assets || true
if ! git diff --cached --quiet; then
git commit -m "chore: optimize images (automated)" || true
git push
else
echo "No changes to commit"
fi