refactor: build site with vitepress #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compress | |
on: | |
push: | |
branches: [main] | |
paths: | |
- "**.jpg" | |
- "**.jpeg" | |
- "**.png" | |
- "**.webp" | |
jobs: | |
compress: | |
runs-on: ubuntu-latest | |
if: github.repository == 'doocs/doocs.github.io' | |
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 "[Automated] Optimize images" -a | |
- name: Push Changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |