update workflow
This commit is contained in:
42
.github/workflows/sync.yml
vendored
Normal file
42
.github/workflows/sync.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Auto update commit and sync to gitee
|
||||
|
||||
on: [ push ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
if: github.actor != 'github-actions[bot]'
|
||||
with:
|
||||
persist-credentials: true
|
||||
- name: Update commit hash to gitVersion
|
||||
if: github.actor != 'github-actions[bot]'
|
||||
run: |
|
||||
git show -s --format=%H | awk 'NR == 1 {p = $0} NR > 1 {print p; p = $0} END{printf p}' > gitVersion
|
||||
- name: Push commit
|
||||
uses: EndBug/add-and-commit@v7.1.2
|
||||
if: github.actor != 'github-actions[bot]'
|
||||
with:
|
||||
add: gitVersion
|
||||
author_name: github-actions[bot]
|
||||
author_email: 41898282+github-actions[bot]@users.noreply.github.com
|
||||
message: Update git tree hash
|
||||
push: true
|
||||
- name: Sync to Private Git Service
|
||||
uses: wearerequired/git-mirror-action@master
|
||||
if: github.actor != 'github-actions[bot]'
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
with:
|
||||
source-repo: git@github.com:StageGuard/SkyAutoPlayerScript.git
|
||||
destination-repo: ubuntu@vps.stageguard.top:StageGuard/SkyAutoPlayerScript.git
|
||||
- name: Sync to Gitee
|
||||
uses: wearerequired/git-mirror-action@master
|
||||
if: github.actor != 'github-actions[bot]'
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
with:
|
||||
source-repo: git@github.com:StageGuard/SkyAutoPlayerScript.git
|
||||
destination-repo: git@gitee.com:stageguard/SkyAutoPlayerScript.git
|
||||
Reference in New Issue
Block a user