chore: update github actions

This commit is contained in:
yanglbme 2021-04-25 11:05:56 +08:00
parent cb7893756b
commit 99e5920d45
4 changed files with 43 additions and 36 deletions

View File

@ -1,17 +0,0 @@
name: Merge Branch
on:
push:
branches: [imgbot]
jobs:
merge-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: everlytic/branch-merge@1.1.0
with:
github_token: ${{ github.token }}
source_ref: ${{ github.ref }}
target_branch: main
commit_message_template: "[Automated] Merged {source_ref} into {target_branch}"

View File

@ -36,8 +36,16 @@ jobs:
run: npm run build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@4.0.0
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: dist
- name: Sync to Gitee
uses: wearerequired/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
with:
source-repo: git@github.com:doocs/md.git
destination-repo: git@gitee.com:Doocs/md.git

34
.github/workflows/compress.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Compress
on:
push:
branches: [main]
paths:
- "**.jpg"
- "**.jpeg"
- "**.png"
- "**.webp"
jobs:
compress:
runs-on: ubuntu-latest
if: github.repository == 'doocs/md'
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 }}

View File

@ -1,18 +0,0 @@
name: Sync
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'doocs/md'
steps:
- name: Sync to Gitee
uses: wearerequired/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
with:
source-repo: git@github.com:doocs/md.git
destination-repo: git@gitee.com:Doocs/md.git