From c5fb2b61433daf5131f0e64fd69834f80a2cd52c Mon Sep 17 00:00:00 2001 From: Misitebao Date: Sat, 29 Jan 2022 07:40:08 +0800 Subject: [PATCH] chore(action): add auto sync script (#1109) --- .../deploy-website-to-wails.top-mirror.yml | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-website-to-wails.top-mirror.yml b/.github/workflows/deploy-website-to-wails.top-mirror.yml index 88966f189..bb16babf7 100644 --- a/.github/workflows/deploy-website-to-wails.top-mirror.yml +++ b/.github/workflows/deploy-website-to-wails.top-mirror.yml @@ -1,10 +1,9 @@ -name: Deploy mirror | 部署镜像 +name: Sync upstream branch and deploy mirror | 同步上游分支并部署镜像 on: - push: - branches: [master] - # pull_request: - # branches: [ main ] + schedule: + - cron: "0 8,20 * * *" + workflow_dispatch: jobs: build-and-deploy: @@ -20,6 +19,22 @@ jobs: submodules: true fetch-depth: 0 + - name: Setup Git | 设置Git + run: | + git config --local user.email "i@misitebao.com" + git config --local user.name "misitebao" + + - name: Add remote upstream repository and sync | 添加远程上游仓库并同步 + run: | + git remote add upstream https://github.com/wailsapp/wails + git pull -v --progress --no-rebase "upstream" master + + - name: Push | 推送 + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} + - name: Build Site | 构建网站 run: | cd website &&