Created
October 8, 2023 06:15
-
-
Save twhite96/3985bf2d68eb0a6c9aedbacdb13600c2 to your computer and use it in GitHub Desktop.
image compression before deployment
This file contains 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: compress-images | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
name: calibreapp/image-actions | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Compress Images | |
id: calibre | |
uses: calibreapp/image-actions@main | |
with: | |
githubToken: ${{ secrets.IMAGE_WORKFLOW }} | |
compressOnly: true | |
- name: Get specific changed files | |
id: changed-files-specific | |
uses: tj-actions/changed-files@v23.1 | |
with: | |
files: | | |
**.svg | |
**.png | |
**.jpeg | |
**.webp | |
files_ignore: | | |
**.yml | |
**.md | |
- name: Run step if only the files listed above change | |
if: steps.changed-files-specific.outputs.only_changed == 'true' | |
run: | | |
echo "Only files listed above have changed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment