Initial commit #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Optimize Images to WebP | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '**.jpg' | |
| - '**.jpeg' | |
| - '**.png' | |
| - 'optimize.py' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| optimize: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install Pillow | |
| - name: Run optimization script | |
| run: python optimize.py | |
| - name: Commit and Push changes | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "chore: auto optimize images to webp [skip ci]" | |
| branch: main | |
| file_pattern: '.' |