自动通过 TinyPNG 优化图片

创建 GitHub Action 动作并复制以下命令

name: image
on:
  pull_request:
    paths:
      - 'static/**'
jobs:
  compress:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}
      - uses: namoscato/action-tinify@v1
        with:
          api_key: ${{ secrets.TINIFY_API_KEY }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
inputdescription
api_keyTinify API key (create one here)
github_tokenGITHUB_TOKEN秘密

来源仓库: namoscato/action-tinify


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!