mirror of
https://github.com/doocs/advanced-java.git
synced 2026-08-18 10:43:29 +08:00
chore: add compress workflow
This commit is contained in:
36
.github/workflows/compress.yml
vendored
Normal file
36
.github/workflows/compress.yml
vendored
Normal file
@@ -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 "action@github.com"
|
||||||
|
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 }}
|
||||||
Reference in New Issue
Block a user