-
Notifications
You must be signed in to change notification settings - Fork 2
35 lines (30 loc) · 994 Bytes
/
sync-to-gitee.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Gitee Sync
run-name: "🎭🔃♾️[${{ github.workflow }}] - ${{ github.event.head_commit.message }}"
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow}}
cancel-in-progress: true
env:
GITEE_REPOSITORY: copdips/copdips.github.io
jobs:
sync_to_gitee:
runs-on: ubuntu-latest
steps:
# - name: sync-gitee-mirror
# uses: abersheeran/sync-gitee-mirror@v1-beta
# # https://github.com/abersheeran/sync-gitee-mirror
# with:
# repository: ${{ env.GITEE_REPOSITORY }}
# username: ${{ vars.GITEE_USERNAME }}
# password: ${{ secrets.GITEE_PAT }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
remote_repo="https://${{ vars.GITEE_USERNAME }}:${{ secrets.GITEE_PAT }}@gitee.com/${{ env.GITEE_REPOSITORY }}.git"
git remote add gitee "${remote_repo}"
branch=$(git branch --show-current)
git push gitee $branch -f