Skip to content

Commit

Permalink
Update optimize-assets.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaGorceva authored Oct 24, 2024
1 parent f965a2d commit bcb6668
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions .github/workflows/optimize-assets.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
name: Optimize Assets
name: Image Optimization

on:
push:
pull_request:
branches:
- main
- main # or your target branch

jobs:
optimize:
optimize-images:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2

# Image compression using calibreapp/image-actions
- name: Optimize Images
uses: calibreapp/image-actions@main
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}

# Minify CSS using cssnano-cli
- name: Minify CSS
run: |
npm install -g cssnano-cli
cssnano styles.css styles.min.css
# Minify JS using terser
- name: Minify JS
run: |
npm install -g terser
terser script.js -o script.min.js
- name: Optimize Images
uses: calibreapp/image-actions@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
jpegquality: 80
pngquality: 80
webpquality: 80

0 comments on commit bcb6668

Please sign in to comment.