Skip to content

Commit 61ff2f1

Browse files
committed
chore: add compress workflow
1 parent 1fe9982 commit 61ff2f1

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Diff for: .github/workflows/compress.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Compress
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "**.jpg"
8+
- "**.jpeg"
9+
- "**.png"
10+
- "**.webp"
11+
workflow_dispatch:
12+
13+
jobs:
14+
compress:
15+
runs-on: ubuntu-latest
16+
if: github.repository == 'doocs/advanced-java'
17+
steps:
18+
- name: Checkout Branch
19+
uses: actions/checkout@v2
20+
21+
- name: Compress Images
22+
uses: calibreapp/image-actions@master
23+
with:
24+
githubToken: ${{ secrets.GITHUB_TOKEN }}
25+
compressOnly: true
26+
27+
- name: Commit Files
28+
run: |
29+
git config --local user.email "action@github.com"
30+
git config --local user.name "GitHub Action"
31+
git commit -m "docs: optimize images" -a
32+
33+
- name: Push Changes
34+
uses: ad-m/github-push-action@master
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)