Skip to content

Compress

Compress #560

# Commit compressed image to the default branch when:
# - at 8 AM every Monday
name: Compress
on:
schedule:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: "0 8 * * 1"
workflow_dispatch:
jobs:
compress:
runs-on: ubuntu-latest
if: github.repository == 'bytebase/bytebase.com'
steps:
- name: Checkout Branch
uses: actions/checkout@v3
- name: Compress Images
id: calibre
uses: calibreapp/image-actions@main
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
compressOnly: true
- name: Commit Files
if: |
steps.calibre.outputs.markdown != ''
run: |
git config --local user.email "[email protected]"
git config --local user.name "support"
git commit -m "chore: auto compress images" -a
- name: Push Changes
if: |
steps.calibre.outputs.markdown != ''
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}