Skip to content

Commit

Permalink
chore: add compress workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Oct 21, 2021
1 parent 1fe9982 commit 61ff2f1
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/compress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Compress

on:
push:
branches: [main]
paths:
- "**.jpg"
- "**.jpeg"
- "**.png"
- "**.webp"
workflow_dispatch:

jobs:
compress:
runs-on: ubuntu-latest
if: github.repository == 'doocs/advanced-java'
steps:
- name: Checkout Branch
uses: actions/checkout@v2

- name: Compress Images
uses: calibreapp/image-actions@master
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
compressOnly: true

- name: Commit Files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "docs: optimize images" -a
- name: Push Changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 61ff2f1

Please sign in to comment.